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

4

9

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.

Fortune answered 3/2, 2020 at 7:56 Comment(2)
And upgrading your node version is not an option? Because I think that would be the best thing to do otherwiseIcebox
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/releasesOjeda
C
2

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
Constrain answered 5/3, 2020 at 12:39 Comment(0)
S
2

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).

Sibylsibylla answered 11/4, 2023 at 5:17 Comment(2)
This reads like a book not an answerGrimbal
@MarkSchultheiss, please just only read the top short summary solution as the answer, not the bottom long long book, Thanks!Sibylsibylla
S
1

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.

Strapper answered 19/8, 2023 at 12:34 Comment(0)
D
0
  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

Deodand answered 20/3, 2023 at 9:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.