Search code examples
nodemondeno

Denon installation failed in Deno v1.18.0


I tried installing denon for running my deno script

I used the following command from their docs,

deno install -qAf --unstable https://deno.land/x/denon/denon.ts

And the command failed with,

error: TS2345 [ERROR]: Argument of type '"any" | "access" | "create" | "modify" | "remove" | "other"' is not assignable to parameter of type 'FileAction'.
  Type '"other"' is not assignable to type 'FileAction'.
            this.#changes[path].push(kind);
                                     ~~~~
    at https://deno.land/x/denon@2.4.10/src/watcher.ts:150:38

P.S. If this is an expected behavior is there any alternative for denon?


Solution

  • Edit: This issue has been fixed in denon v2.5.0

    Original answer:

    This is a known bug in denon, an official fix will be released soon but in the meantime there is a patch which you can install to workaround the issue, see this comment on GitHub:

    deno install -qAf --unstable https://raw.githubusercontent.com/nnmrts/denon/patch-4/denon.ts
    

    You can also downgrade to a version released before the bug was introduced.