The issue that causes EACCES is often a permission issue in two folders:
In the ~ / .npm directory, a permission issue may occur.
The full path to your directory is ~ ~ / .npm: '/Users/YOUR_USERNAME/.npm'; It stores various npm functions. The easiest way to get to your home directory on a unix-based system (I guess on Linux as well) is to enter "cd".
There may also be a problem with permissions on your / usr / local / lib / node_modules.
Here npm tries to store your globally installed modules. This is the system version of the node_modules folder, which you will find mainly in any node.js project that you create and install with dependencies.
I really made a node package that will solve this problem on mac, although I'm not sure about Linux (because the paths to ".npm" and "node_modules" may be different from linux) could you give it a chance? This basically confirms you as the owner of these directories.
Here's the github page:
https://github.com/yvanscher/fixmynode (just note that this package may be deprecated due to a strange build problem with osenv dependency)
If you reinstall node, you can try to change the rights to these commands (which should work on Linux):
sudo chown -R $(whoami) ~ / .npm
sudo chown -R $(whoami) / usr / local / lib / node_modules
NOTE. I am not 100% sure that the paths / usr / local / lib / node_modules and '~ / .npm are correct for Linux based on Node / npm install. Can you post the full error message you get in the terminal?
yvanscher
source share