After updated Node (upto v8.6.0) and npm (upto v5.5.1) I cannot execute command npm install
.
After npm install I\'ve error message:
npm ERR! Can
nodejs@8.6.0 npm@5.5.1 - I have trouble and the test fails
nvm use 8.5.0
nodejs@8.5.0 npm@5.5.1 - I have trouble and the test fails
nvm use 8.4.0
nodejs@8.4.0 npm@5.5.1 - I have trouble and the test fails
npm install npm@^5 -g
nodejs@8.4.0 npm@5.4.2 - I have trouble and the test fails
nvm use 8.6.0
npm install npm@^4 -g
nodejs@8.6.0 npm@4.6.1 - no trouble, this fixes it.
Do 2 steps bellow (Window):
rm -rf ./node_modules
to remove node folder
rm package-lock.json
to remove package-lock.json
file
then npm install
to re-install the node modules
Just download and install latest Yarn which is also a node package manager, developed by facebook, but has a much better dependency management. Also update your node cli (optional).
And then, install your dependencies using yarn
:
yarn install
or
yarn // short version of yarn install
No errors!
You can continue to use npm
after you have installed all dependencies with yarn
or continue with yarn
....it's your choice.
I bumped into this issue using nvs
(Node Version Switcher - https://github.com/jasongin/nvs) node@10.15.3
and npm@6.9.0
. The reason was a local package I had linked with npm link
. The solution was to remove that folder.
For me (npm@6.9.0) solved the issue by deleting node_modules
and performing npm install
, but without removing package.json.lock
file.