JackieWillen
JackieWillen

Reputation: 749

NPM is known not to run on Node.js v9.2.1

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.

Upvotes: 9

Views: 41708

Answers (4)

Gaurav Khanzode
Gaurav Khanzode

Reputation: 21

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.

Upvotes: 2

Vittore Marcas
Vittore Marcas

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

Fast Incorporated
Fast Incorporated

Reputation: 11

  1. Delete manually directory npm and npm-cache in ... AppData/Roaming

  2. Run in your terminal npm cache clean --force

  3. Install your package npm install -g cordova ionic

Upvotes: 0

cool
cool

Reputation: 21

Basically node js 9.2... version is compatible with npm version 5.5.1. So I will provide you the following suggestion.

  1. if you want to work with node js 9.2 only then

    1. uninstall node js 9.2
    2. uninstall npm
    3. install node js 9.2
    4. then install npm version 5.5.1 - npm install -g [email protected]
  2. update node js and npm to the latest version and check your code compatibility with the new version.

To do this

  1. install node js latest version
  2. npm install -g npm@latest

Upvotes: 2

Related Questions