Background: npm i npm-check -g
when reporting error no permission Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
1. Check the owner of the directory
ls -la /usr/local/lib/node_modules
total 0
drwxr-xr-x 3 root wheel 96 6 18 12:42 .
drwxrwxr-x 6 anna admin 192 12 12 15:45 ..
drwxr-xr-x 23 root wheel 736 12 26 2018 npm
Discover node_The module is under the root, so you transfer it to yourself
2. Look who it is now
whoami
anna
It’s Anna, not root, so change it
3. Change the directory owner (note the user name Anna)
sudo chown -R anna: /usr/local/lib/node_modules
Popular science: chown
change the owner of the specified file to the specified user or group, parameter - R
process all files in the specified directory and its subdirectories.
Similar Posts:
- E09 Error: sudo: effective uid is not 0, is sudo installed setuid root?
- Mac download wepy error reporting solution
- ubuntu18.04 Start Android StudioKVM is required to run this AVD ./dev/kvm device: permission denied.
- Git Permission issues: insufficient permission for adding an object to repository database .git
- [Solved] WARN checkPermissions Missing write access to /usr/local/lib/node_modules
- Mac: How to Solve global module install error
- Su command error Su: permission denied [How to Solve]
- Solution of Su command cannot set groups: operation not permitted
- How to Solve MySQL Startup error: mysql-bin.index not found (Errcode: 13)
- Completely Uninstall Node.js from Mac OS X