lilleman
lilleman
DDeno
Created by lilleman on 3/26/2025 in #help
Running deno add npm:xxx via docker results in not found
So, in an experiment to run most things via docker to isolate stuff on my system I'm trying to run Deno via docker. I have a very simple shell script file, /opt/bin/deno like this:
#!/bin/sh

docker run --rm -it --net host -w /srv -v $(pwd):/srv -u $(id -u):$(id -g) denoland/deno:2.2.5 deno "$@"
#!/bin/sh

docker run --rm -it --net host -w /srv -v $(pwd):/srv -u $(id -u):$(id -g) denoland/deno:2.2.5 deno "$@"
This is then added to PATH. Now I try to run deno init test && cd test && deno add npm:ejs and it results in "error: npm:ejs was not found." If I remove -u $(id -u):$(id -g) from the docker run command, the deno add command works, but all files are owned by root and that I don't want. Sooo, what is going on? And any ideas on how to fix it?
2 replies