Permission error when trying to install nodes

I did a clean OS X install. I installed node and node red as before and back then I didn't have any problems. Now with this fresh installation I cannot install anything from manage palettes or using npm install command.

Below is errors/log. Can anyone help with this one? Now I have High sierra OSX. Before that I was running El capitan and I did't have same problems. I'm stuck and cannot get my old configuration to work because I cannot install any nodes I need.

npm WARN checkPermissions Missing write access to /Users/xxxx/node_modules/node-red-dashboard

npm WARN enoent ENOENT: no such file or directory, open '/Users/xxxx/package.json'

npm WARN xxxx No description

npm WARN xxxx No repository field.

npm WARN xxxx No README data

npm WARN xxxx No license field.

npm ERR! path /Users/xxxx/node_modules/node-red-dashboard

npm ERR! code EACCES

npm ERR! errno -13

npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/Users/xxxx/node_modules/node-red-dashboard'

npm ERR! { Error: EACCES: permission denied, access '/Users/xxxx/node_modules/node-red-dashboard'

npm ERR! stack: 'Error: EACCES: permission denied, access '/Users/xxxx/node_modules/node-red-dashboard'',

npm ERR! errno: -13,

npm ERR! code: 'EACCES',

npm ERR! syscall: 'access',

npm ERR! path: '/Users/xxxx/node_modules/node-red-dashboard' }

npm ERR!

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR!

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/xxxx/.npm/_logs/2019-06-17T08_35_22_592Z-debug.log

1 Like

When doing a npm install... in terminal, did you first do a cd .node-red?

If so, go to your user folder (i.e. Users/Paul) and press the shift-command-period keys. This will reveal all the hidden files/folders. Hilight the folder .node-red and do a Get Info (command-i)

Your user should have Read & Write priveledge to it and all it's sub folders.

I tried this earlier with no good luck, but that's because I was only changing read&write privilege to one folder but not to the subfolders. Now when I changed the read&write to subfolders also, it started to work. Big thanks for help!

I followed this and I'm still not able to install any nodes. Both the Admin and my username have read and write permissions and applied to the sub folders.

What system are you trying to install them on.
What error messages do you get?

Sorry should included that info. Mac OSX, Mojave.

2019-09-29T20:25:42.943Z [err] npm 
2019-09-29T20:25:42.943Z [err] ERR!   code: 'EACCES',
2019-09-29T20:25:42.943Z [err] npm
2019-09-29T20:25:42.943Z [err]  ERR!   syscall: 'mkdir',
2019-09-29T20:25:42.943Z [err] npm ERR!
2019-09-29T20:25:42.943Z [err]    path: '/Users/scott/.npm/_cacache/index-v5/b2/d6' }
2019-09-29T20:25:42.943Z [err] npm 
2019-09-29T20:25:42.943Z [err] ERR! 
2019-09-29T20:25:42.943Z [err] npm ERR! The operation was rejected by your operating system.
2019-09-29T20:25:42.943Z [err] npm ERR! It is likely you do not have the permissions to access this file as the current user
2019-09-29T20:25:42.943Z [err] npm ERR! 
2019-09-29T20:25:42.943Z [err] npm ERR!
2019-09-29T20:25:42.943Z [err]  If you believe this might be a permissions issue, please double-check the
2019-09-29T20:25:42.943Z [err] npm ERR!
2019-09-29T20:25:42.943Z [err]  permissions of the file and its containing directories, or try running
2019-09-29T20:25:42.943Z [err] npm 
2019-09-29T20:25:42.943Z [err] ERR! the command again as root/Administrator (though this is not recommended).
2019-09-29T20:25:42.960Z [err] 
2019-09-29T20:25:42.960Z [err] npm ERR! A complete log of this run can be found in:
2019-09-29T20:25:42.960Z [err] npm ERR!     /Users/scott/.npm/_logs/2019-09-29T20_25_42_944Z-debug.log
2019-09-29T20:25:42.967Z rc=243

And you've checked the owner / permissions leading to this path?

1 Like

While not an everyday thing - you can safely delete the whole .npm directory and subfolders - npm will recreate them as required. This is sometimes caused by installing something using sudo when it isn't required - as it then locks the folders to root only access - or by trying to install something with that needs compiling and should probably be using the --unsafe-perm flags... eg npm i --unsafe-perm someNodePackageWithBinary

2 Likes

Had permission on the ~/.npm directory as read and write. Ran the "Apply to the enclosed items" and this seems to have worked.

I was performing that on the ~/.node-red directory.

Node has been added and seems to have worked just fine.

Thanks for the assistance.

Scott