0
I have the following problem executing this command:
npm install -g [email protected] --save-dev --save-exact
Could someone help me?
0
I have the following problem executing this command:
npm install -g [email protected] --save-dev --save-exact
Could someone help me?
2
Avoid running commands npm
sudo. It may seem the easiest solution, but it opens the door for malicious scripts to run on your machine. This article talks a little about the subject.
The solution officially recommended by npm is to reinstall npm using the Node version manager. The installation is very simple and explained in official repository of the project.
If use nvm
is not an option, the other recommendation is to manually change the npm directory:
On the command line, being in the directory home
, create a directory to install global packages:
mkdir ~/.npm-global
Configure npm to use this new directory: npm config set prefix '~/.npm-global'
Add this new directory to PATH
: Create or open the file ~/.profile
and add this line: export PATH=~/.npm-global/bin:$PATH
Restart the terminal or run source ~/.profile
to update the environment variables
Test the new configuration by installing the package globally without sudo: npm install -g [email protected] --save-dev --save-exact
If you are using npm 5.2 or higher, you can use the npx as an alternative to global packages. This article talks more about the subject.
1
Just use "SUDO", this is access permission error
sudo npm install -g [email protected] --save-dev --save-exact
Browser other questions tagged javascript node.js nodemon
You are not signed in. Login or sign up in order to post.
Good morning Raiany, td well ? Apparently it’s a permission issue, basically you’re not allowed to access these directories, try running the command like this: sudo npm install -g [email protected] --save-dev --save-Exact
– Gabriel José de Oliveira
sudo npm install -g [email protected] --save-dev --save-exact
. Read SUDO: What is "sudo su" on Linux?– Augusto Vasques