How To Avoid Permission Issues When Using Denon
Solution 1:
Without knowing the exact error it's hard to give you the correct answer, but denon
is unstable, it has several issues.
One of those errors that you might be affecting you is if you're trying to watch a folder that you may not have ownership you'll get:
error: Uncaught PermissionDenied: Permission denied (oserror13)
for example, if I run denon
on /tmp
I get that error thrown, even if the folder has all permissions.
Even though nodemon
works perfectly on /tmp
.
My recommendation is to use nodemon
until denon
is stable or until there's a better tool for deno
.
You can do so by using --exec
flag
nodemon --exec deno run --allow-net index.ts
For convenience you can use nodemon.json
with the following content:
{"execMap":{"js":"deno run --allow-net","ts":"deno run --allow-net"},"ext":"js,json,ts"}
And now just use: nodemon index.ts
Solution 2:
You can create a denon.json
file in your project root.
{"scripts":{"start":"deno run --allow-env --allow-net server.ts"}}
Then you can run the script this way (assuming denon installed):
denon start
Hope it helps!
Solution 3:
adding --allow-net
solved it for me.
for some reason creating the denon.json
file manually didn't work, so I had to run
deno --init
and add --allow-net
to the start cmd
"start":{"cmd":"deno run --allow-net app.ts","desc":"run my app.ts file"}
Post a Comment for "How To Avoid Permission Issues When Using Denon"