Reputation: 749
Why I use NPM to install something, it will have this problem as below
ERROR: npm is known not to run on Node.js v9.2.1 Node.js 9 is supported but the specific version you're running has a bug known to break npm. Please update to at least 9.0.0 to use this version of npm. You can find the latest release of Node.js at https://nodejs.org/
Then I find some solutions at Stack Overflow.
Almost every answer suggest to use npm uninstall -g npm
first. But when I use this command, it will have the same error as above.
My npm version is 6.13.7
My node version is 9.2.
Upvotes: 9
Views: 41708
Reputation: 21
I had the same problem, I use nvm
for managing the node versions.
Previously I had these versions installed:
1.1.7
14.18.3
6.14.15
Then upgraded to these versions:
1.1.7
(still same)18.16.0
9.5.1
System: Windows
The installation was successful and verified by the node --version
& npm --version
commands.
But then, the npm
commands started failing showing the same error. I tried some ways like updating node and npm separately, re-installing everything, etc. but the issue was still there.
Finally, after some investigation I found that my nvm
version was pretty old at 1.1.7
and I tried updating the nvm
version to the latest at 1.1.11
and then everything started working as expected with upgraded Node.js and NPM versions. Done!!
You can download the latest nvm
(for Windows only) from here.
You can see the Node.js & NPM compatible versions here.
P.S.: The nvm
every time installs the compatible versions of Node.js and NPM for every version.
Upvotes: 2
Reputation: 1215
In short, you accidentally upgrade npm
, Node v9.2.0
using npm v5.5.1
as default,
while the default npm v6.13.7
of node
is node v13.10.0
.
In order to use Node v9.2.0
again, just use below code on your terminal:
cd ~ && nvm install v13.10.0
nvm uninstall v9.2.0
nvm install v9.2.0
nvm uninstall v13.10.0
END!
Others, a long long book about this question(GitHub Gist).
Upvotes: 2
Reputation: 11
Delete manually directory npm
and npm-cache
in ... AppData/Roaming
Run in your terminal npm cache clean --force
Install your package npm install -g cordova ionic
Upvotes: 0
Reputation: 21
Basically node js 9.2... version is compatible with npm version 5.5.1. So I will provide you the following suggestion.
if you want to work with node js 9.2 only then
update node js and npm to the latest version and check your code compatibility with the new version.
To do this
Upvotes: 2