10

npm does not support Node.js v15.5.0 as well as v14.15.3

npm Version: 5.6.0

I upgraded it trough the command: npm i -g npm-upgrade But I don't get version 6, I always get version 5.6.0

I also tried different Node.js versions according to 426750.

I tried following Node.js versions: v15, v14, v12, v9. It doesn't matter which Node.js version I install, i always get the samme error.

I also removed Node.js and updated it as recommended in 47226238, 63196042.

I have no Idea how I can fix this problem. Do you have any suggestion?

david_k
  • 5,843
  • 2
  • 9
  • 16
Kate
  • 181
  • 1
  • 1
  • 13
  • In my case, solution suggested in [63196042](https://stackoverflow.com/q/63196042/4131048) worked, so deleting `npm` and `npm-cache` folder was enough. The root cause was _multiple versions of `npm` or `node` installed in different paths_ as stated in the answer below (so +1 to everyone) – VincenzoC Feb 13 '21 at 16:54

2 Answers2

8

The correct command to update npm is npm install -g npm. At the time of this writing, that will install npm@6.14.10. (If it doesn't, try npm install -g npm@6.)

Installing npm-upgrade instead will install a CLI that updates package.json in projects. It will not update npm itself.

EDIT: The version compatibility stuff is just a warning. Based on the comment below, the ERR! cb.apply is not a function stuff is the real problem. You may have multiple versions of npm or node installed in different paths and your PATH or alias configuration is causing incompatible versions to run with each other.

EDIT (continued): If you are using nvm as a version manager, you can downgrade to a previous version, remove/reinstall the current version of Node.js, and you will have a compatible version of npm. If you are not using nvm, installing it (assuming you are on a development machine and not experiencing these issues in production) and using node and npm provided by it should also solve the issue.

EDIT PART 3: I just noticed you are running Node.js 15.5.0. That ships with npm@7 so do npm install -g npm@7. If that doesn't work, find your executable paths for node and npm. (On UNIX-like operating systems: command -v node and command -v npm.) If they are not in the same directories, that sounds like a problem and you should investigate. It will probably be easiest/best to use the npm that is in the same directory as node. You can try that out by using the full path. If that works, figure out what's wrong with your PATH or your aliases that you're using a different npm and fix that.

Trott
  • 66,479
  • 23
  • 173
  • 212
  • thank you. I used the command `npm install -g npm` . But I still get npm verion 5.6.0. I don't undertand why it is not working. I will send the output in the next command, due the amount of characters are left. – Kate Jan 03 '21 at 08:43
  • `npm install -g npm npm WARN npm npm does not support Node.js v15.5.0 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9. npm WARN npm You can find the latest version at https://nodejs.org/ npm ERR! cb.apply is not a function npm ERR! A complete log of this run can be found in: ... ` – Kate Jan 03 '21 at 13:26
  • `npm version npm WARN npm npm does not support Node.js v15.5.0 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9. npm WARN npm You can find the latest version at https://nodejs.org/ { npm: '5.6.0', ares: '1.17.1', brotli: '1.0.9', cldr: '38.0', icu: '68.1', llhttp: '2.1.3', modules: '88', napi: '7', nghttp2: '1.41.0', node: '15.5.0', openssl: .... ` – Kate Jan 03 '21 at 13:27
  • Try `npm install -g npm@6`. – Trott Jan 03 '21 at 15:06
  • 1
    The version compatibility stuff is just a warning. However the `ERR! cb.apply is not a function` stuff is the real problem. You may have multiple versions of `npm` or `node` installed in different paths and your `PATH` or alias configuration is causing incompatible versions to run with each other. That's just a guess. – Trott Jan 03 '21 at 15:09
-1

Go to the path where you can find the debug log (this file is found in your npm-cache folder) C:\Users\yourname\AppData\Roaming

Delete the NPM and NPM-Cache folder, but DO NOT reinstall node. Once deleted go back to your command line and re-use the command " npm install -g npm@latest "

npm install --force

Divakar
  • 23
  • 6