4

I've gone through what seems to be the definite post on npm ERR cb() never called several times, and I remain stuck trying to install a particular module. (It happens to be apostrophe-site, but attempts to install other modules are also throwing the error).

I have repeatedly tried all the suggestions outlined, even though that much-viewed post is referring to issues with outdated versions of Node and npm. I'm running v.5.9.1 of node and v.3.10.6 of npm.

sudo npm cache clean -f

npm install -g n

sudo n stable

npm install

Same result: npm ERR! cb() never called!

I can't find a good explanation for where this error is actually being thrown, or how to debug further. When and why does this occur?

Community
  • 1
  • 1
bullcitydave
  • 925
  • 1
  • 8
  • 19

1 Answers1

-2

Not sure whether this is an answer as you expect it, but I suggest: Switch to Yarn! - Yarn is a package manger which uses the same package.json file and node_modules folder as npm.

With npm I had the same problem as you: On a CentOS 6 install I got the ERR cb() never called error repeatedly and could not find a way to make npm reliably complete installation of some packages (like webpack for example). - Yarn works flawlessly, even on flaky network connections.

Migration to Yarn is easy. Most subcommands are the same. They have a good Migration guide. Read on to the handy CLI commands comparison at the end.

halloleo
  • 9,216
  • 13
  • 64
  • 122
  • while it can be an option for many, this can't be the answer for all npm users. – Dimitri Kopriwa Mar 13 '20 at 04:38
  • @DimitriKopriwa Agreed. But do you have a better answer? – halloleo Mar 14 '20 at 11:38
  • At some extend, yarn, pnpm will also fail. For example, the 1st failed when they splited the community efforts in multiple software that solve the same purpose. My solution is to restart the pipeline over and over again until it pass and help npm community to fix npm by providing debuggable and useful information. Not awesome but I am not the only one and it's the way it should be. – Dimitri Kopriwa Mar 14 '20 at 14:14