Unable to install node red using docker command

linux@linux-VirtualBox:~/node$ docker run -it -p 1880:1880 --name mynodered** nodered/node-red
throw err;

Error: EACCES: permission denied, open '/usr/local/lib/node_modules/npm/bin/npm-cli.js'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:20)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
linux@linux-VirtualBox:~/node$ npm -v

can you pls help on the above error
I am trying on Ubuntu.

Put sudo out the front to avoid permission issues. Or setup the user to not require sudo when running docker.

sudo docker run -it -p 1880:1880 --name mynodered** nodered/node-red

Also, I'm not sure about those asterisks in the name, particularly without quotes around the whole thing.

In addition don't use docker unless you have a good reason to do that.

That’s interesting and I fear may start a flame war, but I’ve felt so oldschool because I’ve ever only tested docker on my Mac once and run everything on all my rpi3bs with just DietPi as OS and normal installations.

I hear people rave about the encapsulation and ease of updating etc when running docker for each app, but I fear the overhead and the network issues.

Docker containers are fantastic, but are note that they are "containers", meaning it is meant to run on its own.

Node-red can ofcourse be run fine in a container, but once you need to break out of that container, it can become a burden. Let's say you want to use an exec node, any command not available in the container will not work and installing is no option, you will need to recreate the container including the command, and repeat where needed. Same applies to using tcp/udp ports which need to be mapped to the container.

I personally believe that node-red in docker can create more potential problems than it solves.

I don't think you will start a flame war. Docker may well be appropriate for some things but you only have to search the forum here to see the problems others have had using it with node-red. I suspect the main issue is that node red often requires access to assorted system resources and so may not be ideally suited to being run in Docker.

@Colin - I think @bohtho was referring to you starting the flame war :slight_smile: - Docker is a perfectly fine way to run Node-RED (over 1 million downloads since 1.0 can't be wrong...) - but as @bakman2 points out the clue is in the word container. If the user understands Docker then adding Node-RED to it is usually not a problem. The trouble often comes if the user is new to both.

Back to the OP - I don't think those ** are a good idea - but the error does look very odd - no idea why the docker command should be calling npm in that manner - I would expect more output like can't file local image - fetching etc... so yes the question is - is the OP trying to run docker for fun and education to try it out ? or would a normal install of Node-RED be perfectly fine - in which case the recommended install script from the docs is the way to go