I'm trying to get Node Red up and running in docker, but I can't install new palettes. It seems that the node installer is trying to place its modules in the root directory instead of in /data
sudo docker create \
-p 1880:1880 \
-v /usr/share/nodered/data:/data \
--link mosquitto:mosquitto \
--restart unless-stopped \
--user 2003:2003 \
--name nodered \
nodered/node-red-docker:latest
If I try to install from the Manage Palettes area I get the following error:
-----------------------------------------------------------
2019-03-16T06:27:37.017Z Install : node-red-contrib-home-assistant 0.3.2
2019-03-16T06:27:37.054Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-home-assistant@0.3.2
2019-03-16T06:27:37.619Z [err] Unhandled rejection Error: EACCES: permission denied, mkdir '/.npm'
2019-03-16T06:27:37.619Z [err] npm ERR! cb() never called!
2019-03-16T06:27:37.620Z [err]
2019-03-16T06:27:37.620Z [err] npm ERR!
2019-03-16T06:27:37.620Z [err] This is an error with npm itself. Please report this error at:
2019-03-16T06:27:37.620Z [err] npm ERR! <https://npm.community>
2019-03-16T06:27:37.622Z rc=1
And if I try to do it from within the container as suggested, I run into a similar error:
$ cd /data
I have no name!@def387831f9c:/data$ npm install node-red-contrib-home-assistant
Unhandled rejection Error: EACCES: permission denied, mkdir '/.npm'
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
Did I miss something in my setup? Why is node trying to install into / instead of /data?