Was having a issue installing a NodeJS npm
package. On a Digital-Ocean Droplet Ubuntu (14.04) server.
npm install -g PACKAGE-NAME
I even tried with sudo
had the same error.
Error message:
Error: EACCES: permission denied, mkdir '.....etc'
The npm ERR! code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer.
Hope this helps someone took me a while to find a way to get this to install.
sudo npm install -g PACKAGE-NAME --unsafe-perm=true --allow-root
What the flags do:
unsafe-perm - https://docs.npmjs.com/misc/config#unsafe-perm
Default: false if running as root, true otherwise Type: Boolean Set to true to suppress the UID/GID switching when running package scripts. If set explicitly to false, then installing as a non-root user will fail.
allow-root - https://bower.io/docs/api/#allow-root
--allow-root Allows running commands as root. Bower is a user command, there is no need to execute it with superuser permissions. However, if you still want to run commands with sudo, use --allow-root option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With