2
npm WARN npm npm does not support Node.js v15.8.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 6, 8, 9, 10, 11, 12. 
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: npm ERR! /home/ubuntu/.npm/_logs/2021-02-22T19_03_54_554Z-debug.log
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437

2 Answers2

4

Node.js 15.x ships with npm 7.x, so this should not be happening if you are using the version of npm installed with the version of node you are running. The mismatch you see typically happens when someone has multiple versions installed through different mechanisms.

So, for example, if the version of node you're using is installed through nvm but somehow (typically through PATH manipulation or setting an alias) the version of npm you are using is from an old package installation, you may see an error like this.

In your case, the version of npm is very old (judging from the fact that it only supports up to Node.js v12.x). While you can upgrade it, that's probably just delaying the problem rather than solving it. Other weird things are likely to happen. You might be better served by running command -v node and command -v npm and figuring out why the npm path provided by that command is so different from the node path, and then fix that. (If they're not very different, then just update npm with npm install -g npm.)

Trott
  • 66,479
  • 23
  • 173
  • 212
1

A simple and good solution is to upgrade your npm version or the second option is to downgrade your node version.

Download older node version of Node from here

https://nodejs.org/en/download/releases/

Ethanolle
  • 1,106
  • 1
  • 8
  • 26