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! Cannot read property '0' of undefined
What's trouble or I need downgrade node/npm ?
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! Cannot read property '0' of undefined
What's trouble or I need downgrade node/npm ?
Try with nvm(Node Version Manager).it help you to install any node version for any project without any Error.
I had the same problem.
I removed both node_modules and package-lock.json and then did:
And it worked.
Edit by @OwlyMoly Due to new updates and the restriction to old dependencies in package-lock.json is causing this conflicts. By doing
npm install
won't fix this issue. Instead by ditching npm_modules and package-lock.json and doingnpm install
will load a new node_modules and that supposed to be required by package.json. You have to commit the new package-lock.json along with your latest changes of the project.I've made some tests:
nodejs@8.6.0 npm@5.5.1 - I have trouble and the test fails
nodejs@8.5.0 npm@5.5.1 - I have trouble and the test fails
nodejs@8.4.0 npm@5.5.1 - I have trouble and the test fails
nodejs@8.4.0 npm@5.4.2 - I have trouble and the test fails
nodejs@8.6.0 npm@4.6.1 - no trouble, this fixes it.
npm 5.3.0 is broken for windows 10 after upgrading the nodeJS.
You should downgrade the npm, it is a temporary solution but works fine.
npm install -g npm@5.2.0
Seems to be an issue with a combination of factors.
Some workarounds here:
https://github.com/npm/npm/issues/18238
Do 2 steps bellow (Window):
rm -rf ./node_modules
to remove node folderrm package-lock.json
to removepackage-lock.json
filethen
npm install
to re-install the node modules