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 /
Then I find some solutions at Stack Overflow.
npm WARN npm npm does not support Node.js v9.1.0
npm does not support Node.js v9.0.0
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.
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.
npm WARN npm npm does not support Node.js v9.1.0
npm does not support Node.js v9.0.0
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.
Share Improve this question edited May 4, 2023 at 21:38 InSync 10.5k4 gold badges15 silver badges51 bronze badges asked Feb 3, 2020 at 7:56 JackieWillenJackieWillen 7492 gold badges13 silver badges25 bronze badges 2- And upgrading your node version is not an option? Because I think that would be the best thing to do otherwise – daanvanham Commented Feb 3, 2020 at 7:58
- 6 You shouldn't be using Node 9 at all at this point, and if you're not in a position to be confidently upgrading should probably not have been using an odd-numbered, non-LTS version: nodejs.org/en/about/releases – jonrsharpe Commented Feb 3, 2020 at 8:01
4 Answers
Reset to default 2Basically 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
- uninstall node js 9.2
- uninstall npm
- install node js 9.2
- then install npm version 5.5.1 - npm install -g [email protected]
update node js and npm to the latest version and check your code compatibility with the new version.
To do this
- install node js latest version
- npm install -g npm@latest
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).
I had the same problem, I use nvm
for managing the node versions.
Previously I had these versions installed:
- NVM ->
1.1.7
- Node.js ->
14.18.3
- NPM ->
6.14.15
Then upgraded to these versions:
- NVM ->
1.1.7
(still same) - Node.js ->
18.16.0
- NPM ->
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.
Delete manually directory
npm
andnpm-cache
in ... AppData/RoamingRun in your terminal
npm cache clean --force
Install your package
npm install -g cordova ionic