Unhandled rejection Error: EACCES: permission denied,


Good day, I did install node-red in new pc and while trying to install new palette, system denied. the error message are as follows: -

2019-03-29T00:15:07.780Z Install : node-red-contrib-mqtt-broker 0.2.4

2019-03-29T00:15:07.790Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-mqtt-broker@0.2.4
2019-03-29T00:15:08.998Z [err] Unhandled rejection Error: EACCES: permission denied, mkdir '/home/alps/.npm/_cacache/index-v5/88/d6'
2019-03-29T00:15:08.998Z [err] npm ERR!
2019-03-29T00:15:08.998Z [err] cb() never called!
2019-03-29T00:15:08.998Z [err]
2019-03-29T00:15:08.998Z [err] npm ERR!
2019-03-29T00:15:08.998Z [err] This is an error with npm itself. Please report this error at:
2019-03-29T00:15:08.998Z [err] npm ERR!
2019-03-29T00:15:08.998Z [err] https://npm.community
2019-03-29T00:15:09.047Z [err]
2019-03-29T00:15:09.047Z [err] npm
2019-03-29T00:15:09.047Z [err] ERR! A complete log of this run can be found in:
2019-03-29T00:15:09.047Z [err] npm
2019-03-29T00:15:09.047Z [err] ERR! /home/alps/.npm/_logs/2019-03-29T00_15_08_999Z-debug.log
2019-03-29T00:15:09.056Z rc=1

I am able to install manually with --> sudo npm install



This is an error with npm itself. Please report this error at:
2019-03-29T00:15:08.998Z [err] npm ERR!
2019-03-29T00:15:08.998Z [err] https://npm.community

As written in your post, this would appear to be an issue with npm rather than Node-RED



Which version of npm are you using (npm -v)?

What does
ls -l /home/alps/.npm
show and what user are you running under?



Don’t know if this is of any help but by chance I installed NR on my Mac (in addition to a previous installation on RPi3/DietPi) just last night, and decided to try it the Homebrew way on the latest Mac OS X, and got this exact error now and again when installing a bunch of nodes needed in an imported flow. Just a retry of the install button in NR installed them without anymore errors though.



Starting as a systemd service.
31 Mar 16:05:40 - [info]
Welcome to Node-RED

31 Mar 16:05:40 - [info] Node-RED version: v0.20.3
31 Mar 16:05:40 - [info] Node.js version: v11.12.0
31 Mar 16:05:40 - [info] Linux 4.18.0-16-generic x64 LE
31 Mar 16:05:41 - [info] Loading palette nodes
31 Mar 16:05:41 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
31 Mar 16:05:41 - [warn] rpi-gpio : Cannot find Pi RPi.GPIO python library
31 Mar 16:05:41 - [info] Settings file : /home/alps/.node-red/settings.js
31 Mar 16:05:41 - [info] Context store : 'default' [module=memory]
31 Mar 16:05:41 - [info] User directory : /home/alps/.node-red
31 Mar 16:05:41 - [warn] Projects disabled : editorTheme.projects.enabled=false
31 Mar 16:05:41 - [info] Flows file : /home/alps/.node-red/flows_alps-OptiPlex-3060.json
31 Mar 16:05:41 - [info] Server now running at
31 Mar 16:05:41 - [warn]

alps@alps-OptiPlex-3060:~$ ls -l /home/alps/.npm
total 16
-rw-r--r-- 1 root root 171 Mar 29 09:08 anonymous-cli-metrics.json
drwxr-xr-x 5 alps alps 4096 Mar 28 20:34 _cacache
drwxr-xr-x 2 alps alps 4096 Mar 29 09:08 _locks
drwxr-xr-x 2 alps alps 4096 Mar 29 09:02 _logs

I am unable to deploy my project too.



Does that give an access error in the log too?

You didn't answer my question about which user you are running node-red as. I see you are using systemd, post the systemd startup script, which, unless you have written your own will probably be /lib/systemd/system/nodered.service



i did follow the following step : -

sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/nodered.service -O /lib/systemd/system/nodered.service
sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-start -O /usr/bin/node-red-start
sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-stop -O /usr/bin/node-red-stop
sudo chmod +x /usr/bin/node-red-st*
sudo systemctl daemon-reload

Then i did add the user in systemd as per instruction in website

# systemd service file to start Node-RED

Description=Node-RED graphical event wiring tool

# Run as normal pi user - change to the user name you wish to run Node-RED as

# uncomment and edit next line if you need an http proxy
# uncomment the next line for a more verbose log output
#ExecStart=/usr/bin/env node $NODE_OPTIONS red.js $NODE_RED_OPTIONS
ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS
# Use SIGINT to stop
# Auto restart on crash
# Tag things in the log




I see you are using a non-recommended version of nodejs (11.x). The recommended versions are 8.x or 10.x. Whether that would cause that problem I don't know. Also you have not answered the question I asked earlier, what version of npm are you using
npm -v
You should be on version 6.x or above I think.
The recommended way of installing/upgrading node-red and the associated tools on a pi is in the link below. My recommendation would be to uninstall nodejs (I am not sure what the install script will do with a newer version than recommended) then run the upgrade script. That will make sure everything is consistent. If you still have problems then at least we are all starting on the same page.




Isn't this installed on a PC?



I agree it started with saying it was a new PC, but the install steps posted suggest that it is using Raspbian. Unless the same scripts are used for both. I think @tramanah needs to tell us what OS he is running on.



i did the following steps and manage to deploy successfully.

sudo apt-get purge nodejs


bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)
  Stop Node-RED                       βœ”
  Remove old version of Node-RED      βœ”
  Remove old version of Node.js       βœ”
  Update Node.js LTS                  βœ”   Node v10.15.3   Npm 6.4.1
  Clean npm cache                     βœ”
  Install Node-RED core               βœ”   0.20.3 
  Move global nodes to local          -
  Install extra Pi nodes              βœ”
  Npm rebuild existing nodes          -
  Add shortcut commands               βœ”
  Update systemd script               βœ”

Any errors will be logged to   /var/log/nodered-install.log

All done.
  You can now start Node-RED with the command  node-red-start
  or using the icon under   Menu / Programming / Node-RED
  Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started  Sun Mar 31 20:54:37 +08 2019  -  Finished  Sun Mar 31 20:55:22 +08 2019

thank you for your continues support. do really appreciate.

1 Like