npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

[crash] npm ERR! cb() never called!

Same here npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

Centos 6
Node v10.16.0
NPM 6.9.0
npm cache clean -f
Re installing node and reinstalling npm. Nothing worked.


I encountered this error today after upgrading from npm 5 to 6 (on OS X 10.13.5) and managed to “fix” it.

For context, I’ve been running npm install via a shell script that does a bunch of “setup” stuff. The script was setting the file descriptor limit (e.g. ulimit -n 2000) prior to npm install. I discovered that increasing the limit (e.g. ulimit -n 20000) made the error go away.

So I guess it’s due to the number of parallel read-writes to the filesystem that npm 6 is doing?


ulimit -Hn reports 65536 now, and interestingly nothing changed from this morning!
And interestingly, the installation went through right now! : thinking: I do not believe in magic, but it seems we need a witch hunt on my laptop. The major change is with my ISP.


 sudo npm cache verify

This works for ubuntu as far as I know. A little annoying that I have to do this every once-in-a-while, but at least there is a “”“solution”"" to the npm ERR! cb() never called! error. Hope someone finds this useful.


Just to be sure, after setting it, does ulimit -Hn actually report a setting of 20000? What does it report before you set it?


On LTS node 8.12.0 and npm 6.4.1 I was getting the cb() never called error when trying to do this command in a mono-repo

$ create-react-app my-app --scripts-version=react-scripts-ts

I was able to proceed by using $ n 8.11 which installed 8.11.4 and 5.6.0

The install script now works.

I am on Mac OS X 10.13.6 (17G65)


I just got this error also when trying to use create-react-app. Weirdly the actual npm command that fails works if I run it in a new folder (after npm init -y), it’s only when create-react-app launches it that it fails. Maybe it wants a specific version of some package that triggers a bug?

Force cleaning the cache does nothing and ulimit is not conservative so I’m not really sure what it could be. I tried downgrading from 6.4.1 to npm 6.3.0, 6.0.0 and 5.8.0 but they all have the same error.

Is anyone else able to run create-react-app v2.1.1 successfully under Linux?

EDIT: Realised v1.5.2 wasn’t the latest so updated to create-react-app v2.1.1 but with no change. Also tried downgrading to Node 10.9 instead of Node 11.1, but this made no difference either.


I am new NPM. On a private NON-PRODUCTION VSTS build server when running the build I get the following

2018-08-06T09:55:18.7756640Z ##[section]Starting: npm install
2018-08-06T09:55:18.7763942Z ==============================================================================
2018-08-06T09:55:18.7764339Z Task : npm
2018-08-06T09:55:18.7765502Z Version : 1.0.18
2018-08-06T09:55:18.7765850Z Author : Microsoft Corporation
2018-08-06T09:55:18.7766266Z Help : [More Information]
2018-08-06T09:55:18.7766676Z ==============================================================================
2018-08-06T09:55:19.7790108Z [command]C:\windows\system32\cmd.exe /D /S /C ““D:\VSTS Agents\Agent1_work_tool\node\10.8.0\x64\npm.cmd” --version”
2018-08-06T09:55:20.9928629Z 6.2.0
2018-08-06T09:55:21.0104520Z SYSTEMVSSCONNECTION exists true
2018-08-06T09:55:21.5358954Z SYSTEMVSSCONNECTION exists true
2018-08-06T09:55:22.3758546Z SYSTEMVSSCONNECTION exists true
2018-08-06T09:55:22.3759849Z SYSTEMVSSCONNECTION exists true
2018-08-06T09:55:24.6073857Z [command]C:\windows\system32\cmd.exe /D /S /C ““D:\VSTS Agents\Agent1_work_tool\node\10.8.0\x64\npm.cmd” config list”
2018-08-06T09:55:25.7805131Z ; cli configs
2018-08-06T09:55:25.7805829Z metrics-registry = “https://aginsurance.pkgs.visualstudio.com/_packaging/6364c17f-4ff3-4f73-ba33-933dedfa64b1/npm/registry/
2018-08-06T09:55:25.7806315Z scope = “”
2018-08-06T09:55:25.7806627Z user-agent = “npm/6.2.0 node/v10.8.0 win32 x64”
2018-08-06T09:55:25.7806860Z
2018-08-06T09:55:25.7807564Z ; environment configs
2018-08-06T09:55:25.7807977Z https-proxy = “redacted”
2018-08-06T09:55:25.7808357Z proxy = “redacted”
2018-08-06T09:55:25.7808806Z strict-ssl = false
2018-08-06T09:55:25.7809201Z userconfig = “D:\VSTS Agents\Agent1\_work\13\npm\4731.npmrc”
2018-08-06T09:55:25.7809490Z
2018-08-06T09:55:25.7809857Z ; userconfig D:\VSTS Agents\Agent1_work\13\npm\4731.npmrc
2018-08-06T09:55:25.7810369Z registry = “https://aginsurance.pkgs.visualstudio.com/_packaging/6364c17f-4ff3-4f73-ba33-933dedfa64b1/npm/registry/
2018-08-06T09:55:25.7810667Z
2018-08-06T09:55:25.7811049Z ; node bin location = D:\VSTS Agents\Agent1_work_tool\node\10.8.0\x64\node.exe
2018-08-06T09:55:25.7811438Z ; cwd = D:\VSTS Agents\Agent1_work\13\s
2018-08-06T09:55:25.7811909Z ; HOME = C:\Users\VSTSDSRVC
2018-08-06T09:55:25.7812261Z ; “npm config ls -l” to show all defaults.
2018-08-06T09:55:25.7812506Z
2018-08-06T09:55:25.7829765Z [command]C:\windows\system32\cmd.exe /D /S /C ““D:\VSTS Agents\Agent1_work_tool\node\10.8.0\x64\npm.cmd” install”
2018-08-06T09:59:04.8086311Z npm ERR! cb() never called!
2018-08-06T09:59:04.8087446Z
2018-08-06T09:59:04.8088966Z npm ERR! This is an error with npm itself. Please report this error at:
2018-08-06T09:59:04.8090109Z npm ERR! https://npm.community
2018-08-06T09:59:04.8090299Z
2018-08-06T09:59:04.8090742Z npm ERR! A complete log of this run can be found in:
2018-08-06T09:59:04.8092220Z npm ERR! C:\Users\VSTSDSRVC\AppData\Roaming\npm-cache_logs\2018-08-06T09_59_04_709Z-debug.log
2018-08-06T09:59:05.0370485Z Found npm debug log, make sure the path matches with the one in npm’s output: C:\Users\VSTSDSRVC\AppData\Roaming\npm-cache_logs\2018-08-06T09_59_04_709Z-debug.log

I have searched the rather large log file but there doesn’t appear to be any additional useful information: just this at the end:

18242 error cb() never called!
18243 error This is an error with npm itself. Please report this error at:
18244 error https://npm.community

I do not get this error on the PRODUCTION build server which is running npm 5.6.

However on the PRODUCTION build servers I have a different issue altogether which I am still investigating: 3 minute+ delay when trying to run: npm.cmd --version.

Any advice most welcome and appreciated.

Thanks!


Okay. So there had been permission issues due to installing packages as superuser.
Now all you need to do is

sudo chown -R $(whoami) ~/.npm

to fix the permissions.
This solved my issue.


I’ve been able to reproduce the issue and tried both of these options, but still see the error from the original post.


I am still seeing this issue intermittently, but consistently when I run npm dedupe && npm prune && npm install (in a desperate attempt to get jest to work in create-react-app).

Log is attached.

2019-02-08T11_13_31_809Z-debug.log (242.8 KB)


I would love to get rid of them, which is impossible :cold_sweat:. I hope async iteration fixes most of the use cases in the future!


The latest releases fixed it for me. Very good job! May I ask what was the problem?


Thanks !!! This downgrade also works for me!


Windows 10

2 info using npm@6.9.0
3 info using node@v12.4.0

npm ERR! cb() never called! npm ERR! This is an error with npm itself.

There is no indication of the underlying Error.
2019-06-20T06_16_26_609Z-debug.log (621,7 KB)


Could you please try again using the canary?


I too have the same problem unfortunately, raising the limits didn’t work here either.
An interesting note however is that I have several repos where some of them work totally fine and some of them get this error…

node -v
10.8.0

npm -v
6.2.0

CONCLUSION:
Current fix for me was to downgrade npm 6 => 5 and node 10 => 8


The PR in https://github.com/npm/npm/issues/20424 does not appear to be comprehensive enough:

https://github.com/zkat/cacache/pull/136/files

it looks like ssri and/or cacache pass opts objects into figgy-pudding that don’t always provide opts.error, opts.size, etc, but figgy-pudding seems to be validating that the opts object is properly specified. This seems like a structural problem with these libraries and I’m not sure how to fix it.


Seen despite ulimit -n 20000, Linux, in an unmodified official node:8 container with npm 5.6.0 on node 8.11.4. After npm i -g npm@6, got cb() never called again after a perhaps more useful traceback:

Unhandled rejection Error: invalid config key requested: error
    at pudGet (/usr/local/lib/node_modules/npm/node_modules/figgy-pudding/index.js:31:11)
    at FiggyPudding.get (/usr/local/lib/node_modules/npm/node_modules/figgy-pudding/index.js:13:12)
    at Object.get (/usr/local/lib/node_modules/npm/node_modules/figgy-pudding/index.js:71:16)
    at Object.checkData (/usr/local/lib/node_modules/npm/node_modules/ssri/index.js:232:22)
    at write (/usr/local/lib/node_modules/npm/node_modules/cacache/lib/content/write.js:34:31)
    at putData (/usr/local/lib/node_modules/npm/node_modules/cacache/put.js:29:10)
    at Object.x.put (/usr/local/lib/node_modules/npm/node_modules/cacache/locales/en.js:28:37)
    at readFileAsync.then.data (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/file.js:38:28)
    at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
    at /usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/nodeback.js:42:21
    at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16

… which is odd, because I haven’t set the NPM configuration in this container.


I’ve had this problem on my Mac since npm version 5.8.0 and I’ve been stuck at using npm 5.6.0.

I’ve finally got something that seems to point the issue to the number dependencies.

On my machine, with Node 10.9.0 and npm 6.4.1, I got a package.json that fails with this.

If I remove some dependencies, then npm install succeeds.

For example, removing enzyme alone helps.

Removing a bunch of other smaller packages also helps.

Mac is a Mid 2015 MackBook Pro.

MacOS High Sierra 10.13.6.

ulimit output:

$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 1
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1418
virtual memory          (kbytes, -v) unlimited


There are a few things that can cause cb() never called!. (Well, really only one thing, or rather the lack of that one thing, but whatever…)

A few big sources of this will be fixed in the next release. If you’re running into this can you check out the 6.10.2 prerelease, and see if that fixes the problem? Release: 6.10.2-next.0

(If you’re reading this after July 23, 2019, then just update to whatever the latest release is in your future world.)

Thanks!


I’m on a Mac and tried all of this and nothing worked. Windows 10 I pulled the same project and all was good.

Had me thinking.

Delete /Users/{ YOUR USERNAME }/.npm folder.

And like that npm install worked! Hope this helps others.

It appears there is some misplaced or unworked permissions issues with some of the libs in .npm.


i fixed the problem by

npm config rm proxy
npm config rm https-proxy


This is happening to me too, trying a global install of node-clinic. on MacOS 10.14.4, as root, log says:

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/local/bin/node’,
1 verbose cli ‘/usr/local/bin/npm’,
1 verbose cli ‘install’,
1 verbose cli ‘-g’,
1 verbose cli ‘clinic’ ]
2 info using npm@6.9.0
3 info using node@v8.14.0
4 verbose npm-session b6f0072cf509c5f3
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 timing npm Completed in 1196ms
8 error cb() never called!
9 error This is an error with npm itself. Please report this error at:


This fixed my issue as well! Thanks for posting your solution.


I am getting the same error on npm: 6.9.0


Changing the ulimit helped.
I followed these instructions for Mac OS 10.12 and up: https://unix.stackexchange.com/a/293062


If it helps, for me (MacOS also) this behaviour started happening with npm@5.7.0 and has consistently continued with every release since; So, whatever the cause, likely it got introduced there.


In case it’s useful for anyone else, I was getting this error (cb() never called with no other information) specifically on my jenkins build jobs. In the end I found the issue was one of my package dependencies was a git dependency ("dependancyName": "git+http://*.git"), and my docker image didn’t have git installed, and for some reason this was failing completely silently and was reported at all by npm.

I’d recommend looking through your dependencies for any “non-standard” ones, e.g. dependencies in private repos etc., these dependencies might be what are causing the npm i to silently fail.

Hope this helps!


I’ve had the same issue with empty project and it turned out to be permission issue. Somehow (maybe after running npm inint) I have lost ownership of the folder which prevented me from running npm install. Install worked with sudo, but as soon as I tried to run npm install or npm ci without sudo it failed again with cb() never called!. I went through several steps of restoring permissions to all node and npm related directories such as:

The way I discovered it was a permission issue was running npm cache verify which threw EACCESS errors.

Hope this helps.


Hi Kat.

I’ve set up two machines (one Mac mini, one MacBook) with:

Node.js v8.14.0
NPM 6.6.0-next.0

Both are macOS 10.14.1
Both use Homebrew to install Node

Both installing https://github.com/alphagov/govuk-prototype-kit via:
rm -rf node_modules && npm install --force -ddd

One of them gets the dreaded “npm ERR! cb() never called!” and one doesn’t.

Console output (silly logging) here:

Is there anything else I can provide to help debug?


I had a similar error, I failed to create a local development dependency correctly before running install in another project that depended on it, and got this cb() error.

(Thanks for your reply by the way, @danepowell - it got me on the right track for fixing my own issue :smiley:)


I just had this issue after using nodeJS’s package installer for v10.16.0 LTS. I’m not really sure if that was related, but I’m thinking it caused issues with the .npm directory in my user/ directory. The answer from Jason Foglia solved my EACCESS error issue when using npx with create-react-app.


I’m on a Mac (OS X El Capitan 10.11.6. I know, it needs an upgrade). Here’s what happened to me:

I tried to run npm update on one of my projects. It failed with an EACCES error:

npm ERR! Error: EACCES: permission denied, open '/Users/sylvie/.npm/_cacache/index-v5/bd/54/ee8420e14f9029856f38742b28ee1644183ba1c7c09ed2bc00664ca06df8'

Weird, I thought. Anyway I try to sudo it:

npm ERR! cb() never called!

Maybe I’ve got an old version of npm? No, 6.9.0, it’s the latest.

Then I found @JasonFoglia’s answer and tried to delete the .npm folder:

sylvie (master) md-preview $ rm -rf ~/.npm
rm: /Users/sylvie/.npm/_cacache/index-v5/01/9f/a639f4252a5e386099f6b1adc00647c191eac721a4ab61681752f3210299: Permission denied
rm: /Users/sylvie/.npm/_cacache/index-v5/01/9f: Directory not empty
rm: /Users/sylvie/.npm/_cacache/index-v5/01: Directory not empty
rm: /Users/sylvie/.npm/_cacache/index-v5/02/f5/570c8eb3cbc74072cab09b82ef2ae7b2bfdbbe874b7981b8db421ef83457: Permission denied
rm: /Users/sylvie/.npm/_cacache/index-v5/02/f5: Directory not empty
rm: /Users/sylvie/.npm/_cacache/index-v5/02: Directory not empty
rm: /Users/sylvie/.npm/_cacache/index-v5/03/8c/28f45eb9b0b97806ef5ea2cad1d125f88cf12a00d84a5819aa0ee970c3f0: Permission denied
rm: /Users/sylvie/.npm/_cacache/index-v5/03/8c: Directory not empty
rm: /Users/sylvie/.npm/_cacache/index-v5/03/dc/4fea74f6b6193954aefaab1af355500e7ce0566ce346d752bac16bb1a6be: Permission denied

etc…

So I set out to check file permissions for those files that won’t go away.

[sylvie] 48 $ ls -l

total 8

-rw-r--r--  1 root  staff   1.0K  2 Apr 14:27 ebc6011bbce71beb2eedc720381425d1f97f78666041c73893d84f08151f

It turns out those files I can’t delete (and that npm can’t access) don’t just have the wrong permissions, they are owned by root for some reason. It doesn’t sound right. I could be wrong but that may be where the bug is.


Hello. I’m completely not js guy and have faced stable way to reproduce the issue:

# Dockerfile
FROM archlinux/base

RUN echo 'Server = http://mirror.easyname.at/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist && \
  pacman -Syu --noconfirm curl tar npm && \
  curl -L https://github.com/UltimateHackingKeyboard/agent/archive/v1.2.12.tar.gz | tar xz && \
  cd agent-1.2.12 && npm -v && npm install

There are installed packages:

Packages (14) bash-5.0.007-1 c-ares-1.15.0-1 glib2-2.60.2-1 iana-etc-20190504-1 icu-64.2-1 libnsl-1.2.0-1 libuv-1.28.0-1 node-gyp-4.0.0-1 nodejs-11.15.0-1 pcre2-10.33-1 semver-6.0.0-1 curl-7.64.1-2 npm-6.9.0-1 tar-1.32-1

The output of npm install is

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-05-11T17_07_29_693Z-debug.log


I hit this bug trying to create a new React app:

$ npx create-react-app react-demo

Platform info:

OS: Centos 6

$ node -v
v8.15.0

$ npm -v
6.4.1

This box is behind a proxy and the first time I tried to create an app the install hung with “WARNING! Your cache is running out of filedescriptors” messages in squid log. I could finish the install restarting squid several times.

Then I increased nofile limit for squid to 4096 in /etc/security/limits.conf, tried to recreate the app and got “npm ERR! cb() never called!” after timeout.

The error went away when I also increased nofile limit for the user account I used to create the app. So it looks like npm hits “number of files” limit and crashes with “cb() never called!” error after timeout being unable to get a new file descriptor.


I was getting the same error running on windows 10. Was playing around with installing using other versions and started noticing a 401 error buried in the output from them. Once I got the custom registry setup properly everything installed right with the old version so I deleted it all and tried with the latest and everything worked. Maybe errors are getting swallowed with latest leading to this error?

Windows 10 using nvm for windows

latest (had cb error)

downgraded to (got 401 error)


Got the bug today with npm 6.7.0, inside docker. Downgrading to npm 5.6.0 fixed the problem.


Probably this message: ```
cb() never called!

is spread all over their code. How come this is not fixed yet?

when I run "npm install" the second time it worked.

ubuntu
$ npm -v
6.9.0

$ npm install
Unhandled rejection Error: EACCES: permission denied, open '/home/xyz/.npm/_cacache/index-v5/f7/27/4832a465dd2aba44ba80e4360f951117f8b27e0d92f355744bf0591eca99'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/xyz/.npm/_logs/2019-06-21T21_57_57_579Z-debug.log


@impactcolor @mgrahamama @jaydge
This topic is overly long and covering many issues, so not a great place to diagnose individual problems. If you need further help, I suggest looking for a topic that was opened more recently that matches your circumstances, or opening a new topic.


Still getting this error with npm ci, debug log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'ci' ]
2 info using npm@6.7.0
3 info using node@v10.12.0
4 verbose npm-session ad376f23729f63a3
5 info prepare initializing installer
6 verbose prepare starting workers
7 verbose prepare installation prefix: ***
8 verbose prepare using package-lock.json
9 verbose checkLock verifying package-lock data
10 silly tree LogicalTree {
...
6311 silly extractTree kind-of@3.2.2 -> ***
6312 timing npm Completed in 13780ms
6313 error cb() never called!
6314 error This is an error with npm itself. Please report this error at:
6315 error <https://npm.community>


It worked for me… Thank you very much


I also found this problem these days
Using your method
But it didn’t work out:thinking:


Confirmed! Raising the ulimit -n does fix it for me.

As it turns out, the max open file limit was being set to a measly ulimit -n 1024 during shell startup. This got both the soft- and the hard limit set, the latter of which subsequently prevented any attempts to raise it afterwards.

Removing that line restored these soft and hard limits to the system defaults of 256 (as reported by ulimit -Sn) and unlimited (ulimit -Hn) respectively, of which the latter now apparently enables npm install to complete without throwing a fit.

So @zkat, maybe setting your ulimit -n 1024 (or lower) will enable you to finally reproduce the behaviour.


Same error here. Using NPM version 6.2.0 and Node version 8.11.3. I’m using the Angular CLI version 6.0.8
My error log showed the following:

14872 silly extract date-fns@2.0.0-alpha.7 extracted to D:\Angular\Rijksoverheidstheme\RijksoverheidsthemeAnalysis\node_modules.staging\date-fns-80532216 (63460ms)
14873 timing npm Completed in 155205ms
14874 error cb() never called!
14875 error This is an error with npm itself. Please report this error at:
14876 error https://npm.community

I’ll try downgrading and watch what happens.


Would it be possible to get a special build of npm with extra debug logging or something to help those of us that experience this regularly to help diagnose it?

Once it starts happening, it is very reproducible and breaks almost every time. I try downgrading npm version, changing Node version, various things until eventually it starts to work again, but the same fixes don’t seem to work every time.

I used to be able to downgrade back to either 5.5 or 5.6 and get working again, but lately with Node 10 that doesn’t always work either.
It takes anywhere from 10 minutes to hours before I can get back working again. It leaves the node_modules in a bad state where sometimes another npm install or npm update will fix it, and sometimes I have to manually delete folders from node_modules and keep re-installing broken packages one by one until my app or tests work again. Removing node_modules completely just causes it fail again, usually about the same place.

It certainly happens either much more often or only on my projects with large dependency trees.

I would be more than happy to install a custom build of npm next time it happens or run with a custom build for a while so that when it happens we will have better odds of finding and fixing the root cause. I’ve been fighting this issue for almost a year, since somewhere in the 5.6 or 5.7 timeframe.


Traced that to issue 20424, blew away package-lock.json, got a successful npm install --prod-only with npm 5.6.0 and no change to the ulimit.


The above cache verify solution did not work for me.

Running npm 6.9.0, command:

sudo npm install -g yo

Error Log:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/matt/.nvm/versions/node/v8.15.0/bin/node',
1 verbose cli '/Users/matt/.nvm/versions/node/v8.15.0/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'yo' ]
2 info using npm@6.9.0
3 info using node@v8.15.0
4 verbose npm-session 9370d4df76dc72fc
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 timing npm Completed in 677ms
8 error cb() never called!
9 error This is an error with npm itself. Please report this error at:
10 error <https://npm.community>


I still have this error with: npm/6.7.0 node/v10.14.0 win32 x64":

019-02-07T08:46:13.5653099Z 19142 silly extract rxjs@6.3.3 extracted to D:\a\1\s\Pleegzorg\Pleegzorg.Web\ClientApp\node_modules.staging\rxjs-2c6f881a (31066ms)

2019-02-07T08:46:13.5653150Z 19143 silly extract rxjs@6.3.3 extracted to D:\a\1\s\Pleegzorg\Pleegzorg.Web\ClientApp\node_modules.staging\rxjs-dff26e5b (30988ms)

2019-02-07T08:46:13.5653201Z 19144 silly extract rxjs@6.4.0 extracted to D:\a\1\s\Pleegzorg\Pleegzorg.Web\ClientApp\node_modules.staging\rxjs-df39a7cc (31661ms)

2019-02-07T08:46:13.5653251Z 19145 timing npm Completed in 48242ms

2019-02-07T08:46:13.5653301Z 19146 error cb() never called!

2019-02-07T08:46:13.5653348Z 19147 error This is an error with npm itself. Please report this error at:

2019-02-07T08:46:13.5653399Z 19148 error <https://npm.community>

2019-02-07T08:46:13.5653429Z

2019-02-07T08:46:13.5709871Z ##[error]Error: Npm failed with return code: 1

2019-02-07T08:46:13.5735086Z ##[section]Finishing: npm install

npmError.log (1003,4 KB)


We are starting to suspect this problem happens more with projects with large dependency sets.


I tried to npm install discord.js and I got cb() never called! what can I do?


I still get a error when running the command.

“npm ERR! cb() never called!”

Running on Ubuntu 18.04 w/ npm@6.9.0


So … I was getting this same error. I uninstalled NPM and Node and reinstalled. Still got the error. Since I was sitting in a public place I was using my hotspot to connect. However, after I switched to an unsecured wifi connection, NPM install now worked with no errors!


I’m seeing this same issue on NPM 6.1.0 on macOS High Sierra (10.13.6)

I raised the ulimit to 20000 as mentioned in one of the above replies, but this had no impact.

Here is the report from the log file.

silly extract babel-plugin-jsx-vue-functional@2.1.0
timing npm Completed in 367558ms
error cb() never called!
error This is an error with npm itself. Please report this error at:
error <https://github.com/npm/npm/issues>


From the log provided, it seems you’re running npm behind a proxy.

We had the same “npm ERR! cb() never called” when installing packages such as probot.

In our case the problem was not related to npm as it was fixed by increasing the number of file descriptors on the squid proxy server by adding the following to /etc/sysconfig/squid
ulimit -n "131070"


Dear npm!
Add please more debug info!

I re-tried with yarn and what I got:

  1. I had a package with a github address, so I need a git and ssh in my docker image


osx 10.14, updated npm to 6.4.1 and got this cb() error.


I get the same error on a Raspberry (running node-red as a docker):
2019-03-22T16:55:13.733Z Install : node-red-contrib-json 0.2.0

2019-03-22T16:55:15.520Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-json@0.2.0
2019-03-22T16:55:16.612Z [err] npm
2019-03-22T16:55:16.615Z [err]
2019-03-22T16:55:16.618Z [err] info it worked if it ends with ok
2019-03-22T16:55:16.619Z [err] npm info using npm@5.0.3
2019-03-22T16:55:16.619Z [err] npm info using node@v8.1.3
2019-03-22T16:55:19.206Z [err] npm
2019-03-22T16:55:19.208Z [err] ERR! cb() never called!
2019-03-22T16:55:19.208Z [err]
2019-03-22T16:55:19.208Z [err] npm ERR! This is an error with npm itself. Please report this error at:
2019-03-22T16:55:19.208Z [err] npm ERR! https://github.com/npm/npm/issues
2019-03-22T16:55:19.224Z [err]
2019-03-22T16:55:19.225Z [err] npm ERR! A complete log of this run can be found in:
2019-03-22T16:55:19.225Z [err] npm ERR! /usr/src/node-red/.npm/_logs/2019-03-22T16_55_19_212Z-debug.log
2019-03-22T16:55:19.240Z rc=1

I am desperate, I can not add any new nodes to my environment.


Hi!

I received a similar error while trying:
npm install

Unhandled rejection Error: Command failed: C:\Program Files\Git\cmd\git.EXE checkout 4.0o D:\Rupesh\WorkData\Self\RnD\Node.js\json-forms\aurelia-formio\exam
error: pathspec '4.0' did not match any file(s) known to git.

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Rupesh\AppData\Roaming\npm-cache\_logs\2019-01-03T10_59_11_787Z-debug.log

I cloned from: https://github.com/formio/aurelia-formio

cd aurelia-formio
npm install
cd example
npm install  <-- here I received this error!

My Node version is 10.14.2
My NPM version is 6.4.1
My OS is Microsoft Windows [Version 10.0.17134.472]

Kindly suggest workaround!

Thank you
Rupesh


This seems to happen pretty consistently for me, Mac OS 10.13.6, npm 6.4.0, node 10.4.1, I get this stack trace:

Unhandled rejection Error: invalid config key requested: error
    at pudGet (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/figgy-pudding/index.js:31:11)
    at FiggyPudding.get (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/figgy-pudding/index.js:13:12)
    at Object.get (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/figgy-pudding/index.js:71:16)
    at Object.checkData (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/ssri/index.js:232:22)
    at write (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/cacache/lib/content/write.js:34:31)
    at putData (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/cacache/put.js:29:10)
    at Object.x.put (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/cacache/locales/en.js:28:37)
    at readFileAsync.then.data (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/pacote/lib/fetchers/file.js:38:28)
    at tryCatcher (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
    at /Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/bluebird/js/release/nodeback.js:42:21
    at /Users/jpollak/.rush/npm-6.4.0/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16

(similar to a stack trace above)

Worse, npm seems to stall downloading packages and never completes.


I can confirm this happens sporadically to me with https://github.com/fastify/fastify, https://github.com/fastify/fastify-react, https://github.com/pinojs/pino and many more.

All of those pull in a vast number of (similar) dependencies in development.

The version of Node.js does not influecence this, it happens to both Node 8 and Node 10 with npm 6.4.1.


I just encountered this error as well, using node 10.16.0 and npm 6.9.0 on Mac OSX 10.14.5.

The log file is here, in case it’s helpful to you guys:

Thanks!


$ npm install
Unhandled rejection RangeError: Maximum call stack size exceeded
at RegExp.test ()
at D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\node_modules\aproba\index.js:38:16
at Array.forEach ()
at module.exports (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\node_modules\aproba\index.js:33:11)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:37:3)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
at flatNameFromTree (D:\TTFdownloads\nodejs\ndoe_global\node_modules\npm\lib\install\flatten-tree.js:39:14)
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! D:\TTFdownloads\nodejs\node_cache_logs\2018-10-01T05_59_58_919Z-debug.log

what’s wrong ???who can tell me how to solve this erro…i have tried many methods,but it still like this


(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)


I also had this issue. One of the package was from github, I needed to have git installed on the system.


I ask that anyone still experiencing this bug in new ways please post a debug log or other clues as to what is happening.


I’ve hit this issue this morning when building a docker image for an express.js based app.
(very similar to https://nodejs.org/en/docs/guides/nodejs-docker-webapp/)

Running the npx npm@next install appears to have fixed this for me locally.


Just got this problem as well.
npm version 6.7.0
node version v8.9.1
Been trying to fix this with ‘tips’ in this thread (way to long btw, someone from npm should look into this issue) but nothing does it.
If I run for example: sudo npm outdated -g
I first get a lot of 'Unhandled rejection Error: EISDIR: illegal operation on a directory'
And at the end it says:
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

So this is me reporting it in the nåm community. Or is there any other way to report errors like this…?


I’m unable to recreate the bug, using the latest node and npm. My ulimit was set to unlimited, so I lowered it to a measly 500 and tried again, still works for me. Running OSX 10.12.1 … maybe not helpful but just putting it out there.


I usually find that a second npm install simply succeeds when run in succession to a failed one.

Assuming that the ulimit -Hn setting is the main culprit here, this actually makes sense, because there’s simply less stuff left to install the second time round; some dependencies will have installed just fine on the first attempt and so your node_modules will already be partly populated.

But whether this will result in a healthy node_modules set without defects, I do not know.


Good to know it’s been fixed but nodejs-8 nodesource package comes with npm-6.4.1 and this can’t be easily fixed on rpm-based distros. The post may still be usefult to those stuck with nodejs-8 on RHEL and derivatives.


Hey y’all!

If you’re still experiencing this, we released a new npm@next and I’m wondering if any of y’all that can reliably reproduce this could test that version out and see if it helps. Try it with this:

$ npx npm@next install

If that doesn’t work, there’s also the Canary with a separate set of patches that you can try using this line:

$ npx npmc install

Let me know if either of those work!


Confirming this observation.

I wonder if there is a way to let npmc run in some kind of a sequential install mode to work around the issue for now. :open_hands:


Please refer further up the thread. The cb never called issue is fixed as of npm@6.6.0. You may hit a separate bug but that deserves a separate ticket.


I am getting this with a ProGet registry we have set up. Found a way to repro using docker. You’ll have to fill in some information though regarding a private registry/proxy server

docker run --rm -ti --name tmp --entrypoint sh --privileged node:8.11.4
> mkdir /app
> cd /app
> echo '{
  ..package.json
}
' > /app/package.json
> npm config set \
  @company:registry \
  https://my.npm.registry/npm/
> npm config set strict-ssl false
> npm config set https-proxy https://user:pass@vpn.company.com


@jakkso I wrote up detailed instructions to hopefully resolve your situation here: Error: while installing http-server on MacOS Mojave 10.14.2

The canonical topic for current EISDIR problems is: Global installs (sudo npm i -g) fail on Mac after 6.5 upgrade. Works fine after 6.4.1 downgrade.


I got this error when a local development dependency (i.e. “my-package”: “file:…/my-package”) didn’t exist. Of course that’s partially my fault for not ensuring that it existed, but I think the installer should check whether the directory exists instead of throwing this completely cryptic error.

Edit: in trying to reproduce this with another package I got a different error, so maybe I did get bitten by the same underlying bug originally: Could not install from "../my-package" as it does not contain a package.json file.


Yes, @shadowspawn directed me to it. What you described matches my problem very closely. Thank you for exploring this.

In the end I got around the problem by installing nvm, since I’m the only one who needs npm on this computer.


Hello, I also can reproduce this error:

npm verb lock using /Users/dayvaler/.npm/_locks/staging-02645998c96d1929.lock for /Users/dayvaler/workspace/dhl/pt/node_modules/.staging
npm timing audit compress Completed in 1937ms
npm info audit Submitting payload of 176216bytes
npm timing audit submit Completed in 2604ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 2602ms
npm timing audit body Completed in 2ms
npm timing action:extract Completed in 25617ms
npm timing action:finalize Completed in 16350ms
npm timing npm Completed in 143302ms
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

Under npm 6.1 >

The weird behaviour in my case is that it just stopped working, and starting to crash. I already set the ulimit to unlimited or 1024 or 2000. Still no solution.

Could it be that npm is trying to use more resources than the ones that my computer has available, and therefore crashes? In the activity monitor I see that when I run an install npm uses more than 100% of the cpu.

I have

MacBook Pro (Retina, 15-inch, Late 2013)
with High Sierra 10.12.6 (16G1510)

The only solution I got was to downgrade to npm 5


I have been not been able to run npm install on y laravel 5.6 and 5.3 projects i have tried several fixes availabe like the the forced cache clear and node reinstallation but npm install still gives npm ERR! cb() never called! I attached the error log file. Someone pls help 2018-08-06T10_42_03_250Z-debug.log (527.2 KB)


Thanks for the tip, I downgraded and finally got passed the cb() error. For what it’s worth it worked on node v10.10.0 with npm 5.6.0 for me :)

EDIT: Scratch that, didn’t work with 10.10.0, downgrading node to 8.11.3 now :sunny:


npm.log (1.6 MB)

Attached is a failed install log. Every install I do, even a small sample project (in this casedebug-level), this error occurs. MacOS Sierra 10.12.6, npm version 6.2.0, node 10.7.0.


Greetings, persons,
I am very new to node/npm/web development but I think I might have figured it out (at least for me (Windows 10 build 17763)).
When ever I ran npm install I noticied that Windows defender cpu usage would suddenly spike–so I added an exception in the settings and voila! no more cb() never called! Given this, I would posit that perhaps anti-malware processes are interfering with the install process?


Downgrading to NPM version 5.6.0 worked for me (still with same Node.js version 8.11.3). I looked up which npm version would be suitable for the Node.js version I had in this table: https://nodejs.org/en/download/releases/

npm install -g npm@5.6.0


You are actually getting a “permission denied” error. npm is trying to write to a directory that it doesn’t have access to.


中国windows以及linux环境,复现:
rm -rf node_modules package-lock.json && npm cache clear --force
npm i
尝试了版本:
13:22:53 + npm --version
13:22:53 5.6.0
13:22:53 + node --version
13:22:53 v8.10.0

13:20:36 + npm --version
13:20:39 6.5.0
13:20:39 + node --version
13:20:39 v8.11.3

13:28:24 + npm --version
13:28:24 5.6.0
13:28:24 + node --version
13:28:24 v8.11.1

解决:
更换npm的镜像源:
1.临时使用

npm --registry https://registry.npm.taobao.org install express
1
2.持久使用

npm config set registry https://registry.npm.taobao.org
1
配置后可通过下面方式来验证是否成功
npm config get registry

npm info express
3.通过cnpm使用

npm install -g cnpm --registry=https://registry.npm.taobao.org
1
使用
cnpm install express

node采用源码包tar.gz安装,windows使用nvm安装
安装node之后会自动安装一个npm,如想安装指定版本npm:npm install -g npm@5.0.0


发现的原因是使用cnpm install,node_modules即可正常下载,不然会报错


Seems like the 4.0 tag doesn’t exist anymore in the gulp repository, but is still required here.


Getting the same error (after a series of strange cryptic issues while trying to start up a new webpack project)

See error log:
https://pastebin.com/ui3Xk74W


Hey y’all!

tl;dr try this: $ npx npmc@latest install

I’ve released a new npm canary with some patches that will stop dropping cb never called errors when certain error types pop up. Note that you may very well still get an error, but it should be more informative now, and I assume it’s going to be the ENFILE issue in most cases. I have a different idea for those, so if you confirm that, I can try the new thing and release a new canary.

Thanks y’all for your patience, I assure you this bug has been as exasperating for me as I imagine as it’s been for you. Kudos to @iarna for finally managing to reproduce it on her own server, which allowed her to do deeper debugging and come up with a patch.

Anyway, please let me know if you still get the cb never called with the canary!


Now trying canary:

rm -rf node_modules && npx npmc install --force -ddd

Different error now:

npm ERR! code ENFILE
npm ERR! errno -23
npm ERR! syscall scandir
npm ERR! ENFILE: file table overflow, scandir '/Users/colin/.npm/_npx/29779'
npm verb exit [ -23, true ]

Full silly log here:

Maximum open file limit reached?


FWIW we’ve seen this behavior occur on our CI behind a firewall when package-lock.json had entries from registry.npmjs.com instead of just our internal registry and also when using relative package paths (ex: "name": "../name") that do not exist.

(For the former situation, this bug might be related to another behavior I’ve noticed: if registry.npmjs.com had been previously used for a different project, when using a different registry to install and generate a new package-lock.json the generated lock file contains references to registry.npmjs.com instead of the specified registry. The only workaround I’ve found for this is to clear out the cache and attempt the install again.)


This was originally posted about a year ago, and many versions back. Because of the very generic error when npm closes without completing, a lot of folks come here thinking that it’s “the same problem”, when in fact, their problem is likely very different. (The OP issue was root-caused and fixed long ago.)

If you’ve found yourself here, the best thing you can do is update to the latest and greatest npm version, and see if that fixes the problem. If it doesn’t, post a new issue.

I’m going to close this so that it stops being an attractive nuisance for newcomers. The goal is to get your bug fixed, rather than lost in the noise.

:heart:


Downloaded the lastest copy of Node from https://nodejs.org and installed it. That seems to fix the problem for me.


May I know the steps to change the reference?


I was receiving this error when attempting to ‘npm install’ an Aurelia CLI project I had built. I discovered the source of the problem was the package.json had a dev dependency on Gulp and was referencing it via “github:gulpjs/gulp#4.0”. This was failing as the Gulp team apparently made this inaccessible since my project was initially created. Changing the reference to “^4.0.0” fixed the issue.


I still can’t reproduce this with your repo, but this is a known thing I’ve been trying to track down. I don’t really know why it’s happening and it seems to have to do with how the CLI is handling registry hangups.

This is technically a duplicate of npm ERR! cb() never called!, but I’m gonna close that one in favor of this one because this one’s actually formatted like a bug report, and it’s definitely a bug.


Also seeing this when trying to create a new Vue project with the new vue-cli.
I’m on OSX 10.13.3 | node 10.6 | npm 6.1

Vue CLI v3.0.0-rc.5
⠋  Creating project in /Users/antc/code/qualitista/training-wheels.hasProjectGit /Users/antc/code/qualitista/training-wheels false
✨  Creating project in /Users/antc/code/qualitista/training-wheels.
🗃  Initializing git repository...
⚙  Installing CLI plugins. This might take a while...

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
 ERROR  command failed: npm install --loglevel error

I’m unfortunately unable to run the install with the error loglevel, as it’s hidden somewhere deep within vue create and vue create -- --loglevel error didn’t help, sorry :confused:

The last phase of the install that I see is refresh-package-json before it fails:

⸨            ░░░░░░⸩ ⠹ refresh-package-json:eventsource: sill refresh-package-json


Hello guys, I still have the cb() never called problem when trying to install Parsoid for my mediaWiki, i’m running on Windows, I tried to download the npmc but maybe I don’t know how to use it, here’s my log 2019-03-23T17_23_40_940Z-debug.log (545,5 Ko)


It seems that in my case, every thing is OK.


Hello, I am new to all of this:

Getting this error creating a new Vue CLI project v3.8.2
Mac OS 10.14.5
npm v6.9
node v10.15.3

:card_file_box: Initializing git repository…
:gear: Installing CLI plugins. This might take a while…

Unhandled rejection Error: EACCES: permission denied, open ‘/Users/jwharris/.npm/_cacache/index-v5/55/91/9d0601d6516185dc28d8b9d3d814a86c9a8906d58c600e62b694787f4754’

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jwharris/.npm/_logs/2019-05-31T00_05_27_484Z-debug.log
ERROR command failed: npm install --loglevel error
Js-iMac:~ jwharris$


Been stuck with this issue since yesterday… Finally I have tried this -->
Current fix for me was to downgrade npm 6 => 5 and node 10 => 8

Previously my node version was 8.11.3 and npm version was 6.3.0
After downgrading my npm version to 5.0.0 (npm install -g npm@5.0.0) Nativescript installed successfully…
Thank you very much sigsiroos


Still getting the same error

$ npm i -g hint
Unhandled rejection Error: EACCES: permission denied, open '/home/pasquale/.npm/_cacache/index-v5/03/f6/db619231354326c85da546de337d3864014c0022bafdc387f0fa91391349'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     ~/.npm/_logs/2019-01-31T11_12_27_043Z-debug.log
$ npm -v                                                                                         
6.6.0

Here is the log for trying to install webhints (15.1 KB)


Had this error when attempting to upgrade node, ran command sudo npm install -g n directly after having cleaned the cache ( via running sudo npm cache clean -f)

It appears that it’s a directory access error: Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/Xander/.npm/_cacache/tmp' The directory exists, so I’m not sure why it cannot access the directory

Here’s the error log
0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/local/bin/node’,
1 verbose cli ‘/usr/local/bin/npm’,
1 verbose cli ‘install’,
1 verbose cli ‘-g’,
1 verbose cli ‘n’ ]
2 info using npm@6.7.0
3 info using node@v8.9.4
4 verbose npm-session ab30e72da09b5213
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 timing npm Completed in 744ms
8 error cb() never called!
9 error This is an error with npm itself. Please report this error at:
10 error <https://npm.community>


This worked for me. I downgraded to node 8 and npm 5.0.0


(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)


We’ve tried raising limits. Doesn’t fix it for my teammate. :(


i faced this on Arch Linux machine . Any fix spotted ?


Sir pls am fairly new to programming how do you increase the ulimit -n 20000 I am building a laravel 5.6 project and am running node

v8.11.3 and npm 5.6.0


I hit this issue with npm 6.5.0 and then I downgraded to 5.6, but still I am having this issue:

npm install --verbose --debug

npm info it worked if it ends with ok

npm verb cli [ ‘/usr/local/bin/node’,

npm verb cli ‘/usr/local/bin/npm’,

npm verb cli ‘install’,

npm verb cli ‘–verbose’,

npm verb cli ‘–debug’ ]

npm info using npm@5.6.0

npm info using node@v10.2.1

npm verb npm-session ccc81709594605cf

npm info lifecycle mce-ui@0.0.0~preinstall: mce-ui@0.0.0

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:

npm ERR! <https://github.com/npm/npm/issues>

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/xxxxxx/.npm/_logs/2019-02-05T14_24_59_426Z-debug.log


It is certainly not resolved. I have a teammate who is stuck on npm 5.6 because all newer versions exhibit this issue. (always starting installs fresh… never continuing with existing node_modules)

I have yet to find the culprit for it.


I am trying to run
npm install -g composer-rest-server@0.19

on Ubuntu 16.04 on a virtual machine,
I tried ulimit -n 20000,
and unfortunately, still getting a similar error.


Issue was this morning resolved without any changes. Also the issue of npm commands taking several minutes was resolved by moving from 5.6 to 6.1/6.2/6.3


@tivrfoa I wrote up an idea which covers problems with the error message, but I did not come up with good wording: Reword guidance for "error cb() never called!"


What I Wanted to Do

npm install to complete without errors

What Happened Instead

The process stopped without giving any description or writing a log

Reproduction Steps

A fresh install with this package: https://gist.github.com/gilbarbara/6c4d8851898bf1eb2968876cb6c1fd8d

Details

In my preliminary tests, I’ve found that removing cypress, stylelint* and webpack* cleared the error.

no log generated

Platform Info

$ npm --versions
6.2.0
$ node -p process.platform
darwin


sudo rm -rf /usr/local/lib/node_modules/

Then install npm/node again


Hey @shadowspawn, thanks for the quick reply. The solution from @JasonFoglia seemed to work for me.


Hi @Jwill! The " ERR! cb() never called!" in the title is a generic final error, and there is an underlying more specific error. This topic/discussion turned out to be about a failure to display the underlying error, which has been fixed. And you would struggle to wade through the many replies to realise that!

Your underlying error is the EACCES error. Have a search for that and see if you find a solution in another topic, or find a topic with similar details to add to, or want to open a new topic.

(I am not going to offer any specific suggestions in this topic to move new discussions elsewhere! :slight_smile: )


Can you explain the steps you took to restore permissions to those folders? I am totally unfamiliar with that process. Currently running Ubuntu 18.04 on my machine, if that makes a difference.


It is overly long because the error message is the same. “cb() never called!”
Developers should be more creative with their error messages


@JasonFoglia, thank you for the suggestion! Deleting the .npm folder in my user directory fixed the issue. I do not know if that folder is necessary for anything else, but for now that seems to be the only working solution for me.

I should note that prior to that, I followed @shadowspawn’s directions for correcting Node’s folder access permissions as well. Thank you both for the help!


Hi,

I’m getting the same error with NPM 6.8.0 in Docker. Within a local image it runs fine, but when it comes to Travis, I can’t get rid of this error, with no further logs.

I give you the Travis log:

docker run -it -e "NODE_ENV=test" -e "PORTAL_URL=https://www.kalaxia.com" -e "API_URL=http://kalaxia_nginx" kalaxia/front
6.8.0
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-02-21T11_11_26_681Z-debug.log
m ##### <- What is that ? ##########
> app@1.0.0 test /srv/app
> jest --runInBand
 sh: jest: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! app@1.0.0 test: `jest --runInBand`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the app@1.0.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-02-21T11_11_27_123Z-debug.log
The command "docker run -it -e "NODE_ENV=test" -e "PORTAL_URL=https://www.kalaxia.com" -e  "API_URL=http://kalaxia_nginx" kalaxia/front" exited with 1.

Just in case, I give you my Docker files:
Dockerfile

FROM node:alpine

WORKDIR /srv/app

COPY . /srv/app
COPY docker-entrypoint.sh /entrypoint.sh

RUN chmod a+x /entrypoint.sh && chown root:root /entrypoint.sh \
    && npm i -g npm

ENTRYPOINT ["/entrypoint.sh"]

docker-entrypoint.sh

#!/bin/sh
npm -v
npm install

if [ "$NODE_ENV" == "production" ]
then
    npm run build &amp;&amp; npm run start
elif [ "$NODE_ENV" == "test" ]
then
    npm run test
else
    npm run dev
fi


It worked fine for me with superuser access.
EACCES: permission denied made me think that it was some permission error.
So

sudo npm install

worked for me.
I am still not sure why the access to npm cache must be restricted to superuser.
Can someone please confirm this if this is still active?


I am still seeing this issue even after trying all suggested fixes and using the latest canary build.

Step 1/6 : FROM node:lts-alpine
 ---> 288d2f688643
Step 2/6 : WORKDIR /app
 ---> 8a03560b600e
Removing intermediate container 703ab6f8d0b2
Step 3/6 : COPY package.json /app/
 ---> dc5be0c8dceb
Removing intermediate container 5871edfea445
Step 4/6 : RUN npx npmc@latest install --verbose
 ---> Running in dc7923b313af

e[91me[0me[91mnpx: installed 426 in 14.098s
e[0me[91mnpme[0me[91m info it worked if it ends with ok
e[0me[91mnpme[0me[91m e[0me[91mverb e[0me[91mcli [ '/usr/local/bin/node',
e[0me[91mnpm verb e[0me[91mcli   '/root/.npm/_npx/1/bin/npmc',
npme[0me[91m verb clie[0me[91m   'install',
npm e[0me[91mverb clie[0me[91m   '--verbose' ]
e[0me[91mnpm infoe[0me[91m usinge[0me[91m npm@6.7.0-canary.1
npme[0me[91m infoe[0me[91m usinge[0me[91m node@v10.15.0
e[0me[91mnpme[0me[91m noticee[0me[91m CANARYe[0me[91m npmc is experimental software. If you find an issue, please file it in the main npm repository, and call out that you were using npmc.
e[0me[91mnpm e[0me[91mverb e[0me[91mnpm-session 7d5195dd96ffbb82
e[0me[91mnpm info lifecyclee[0me[91m box-office@1.0.0~preinstall: box-office@1.0.0
e[0me[91mnpm timinge[0me[91m e[0me[91mstage:loadCurrentTree Completed in 18ms
e[0me[91mnpme[0me[91m timinge[0me[91m stage:loadIdealTree:cloneCurrentTreee[0me[91m Completed in 1ms
e[0me[91mnpm timing stage:loadIdealTree:loadShrinkwrape[0me[91m Completed in 7ms
e[0me[91mnpm http fetche[0me[91m GET 200 https://registry.npmjs.org/bootstrap-sass 333ms
e[0me[91mnpm httpe[0me[91m fetch GET 200 https://registry.npmjs.org/@babel%2fregister 342ms
e[0me[91mnpm httpe[0me[91m fetch GET 200 https://registry.npmjs.org/@babel%2fpreset-env 345ms
e[0me[91mnpm e[0me[91mhttp fetche[0me[91m GET 200 https://registry.npmjs.org/assets-webpack-plugin 343ms
e[0me[91mnpm httpe[0me[91m fetch GET 200 https://registry.npmjs.org/@babel%2fplugin-proposal-object-rest-spread 353ms
e[0me[91mnpme[0me[91m http fetche[0me[91m GET 200 https://registry.npmjs.org/clean-webpack-plugin 346ms
......
e[0me[91mnpm e[0me[91mhttpe[0me[91m fetch GET 200 https://registry.npmjs.org/wordwrap 50ms
e[0me[91mnpm http fetche[0me[91m GET 200 https://registry.npmjs.org/fast-levenshtein 53ms
e[0me[91mnpm httpe[0me[91m e[0me[91mfetch GET 200 https://registry.npmjs.org/rxjs 128ms
e[0me[91mnpm http fetche[0me[91m GET 200 https://registry.npmjs.org/type-check 127ms
e[0me[91mnpm e[0me[91mhttp fetche[0me[91m GET 200 https://registry.npmjs.org/slice-ansi 49ms
e[0me[91mnpm httpe[0me[91m fetch GET 200 https://registry.npmjs.org/chownr 43ms
e[0me[91mnpm httpe[0me[91m fetch GET 200 https://registry.npmjs.org/ansi-regex 54ms
e[0me[91mnpm http fetche[0me[91m GET 200 https://registry.npmjs.org/mississippi 49ms
e[0me[91mnpm httpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/bluebird 59ms
e[0me[91mnpm httpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/lru-cache 67ms
e[0me[91mnpm e[0me[91mhttp fetche[0me[91m GET 200 https://registry.npmjs.org/graceful-fs 71ms
e[0me[91mnpm httpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/promise-inflight 58ms
e[0me[91mnpm e[0me[91mhttp e[0me[91mfetche[0me[91m GET 200 https://registry.npmjs.org/move-concurrently 65ms
e[0me[91mnpm http fetche[0me[91m GET 200 https://registry.npmjs.org/ssri 48ms
e[0me[91mnpm http e[0me[91mfetche[0me[91m GET 200 https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz 58ms
e[0me[91mnpm e[0me[91mhttp fetch GET 200 https://registry.npmjs.org/y18n 47ms
e[0me[91mnpme[0me[91m e[0me[91mhttp fetch GET 200 https://registry.npmjs.org/is-extglob 42ms
e[0me[91mnpm e[0me[91mhttpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/ansi-wrap 48ms
e[0me[91mnpm e[0me[91mhttpe[0me[91m e[0me[91mfetche[0me[91m GET 200 https://registry.npmjs.org/array-union 58ms
e[0me[91mnpme[0me[91m e[0me[91mhttpe[0me[91m e[0me[91mfetche[0me[91m GET 200 https://registry.npmjs.org/dir-glob 62ms
e[0me[91mnpm e[0me[91mhttp e[0me[91mfetche[0me[91m GET 200 https://registry.npmjs.org/slash 72ms
e[0me[91mnpm e[0me[91mhttpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/cosmiconfig 82ms
e[0me[91mnpm e[0me[91mhttpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/is-resolvable 78ms
e[0me[91mnpm e[0me[91mhttp e[0me[91mfetch GET 200 https://registry.npmjs.org/cssnano-preset-default 97ms
e[0me[91mnpm e[0me[91mhttp fetch GET 200 https://registry.npmjs.org/unique-filename 172ms
e[0me[91mnpm http e[0me[91mfetch GET 200 https://registry.npmjs.org/source-list-map 82ms
e[0me[91mnpm httpe[0me[91m e[0me[91mfetch GET 200 https://registry.npmjs.org/bin-check 90ms
e[0me[91mnpm http e[0me[91mfetche[0me[91m GET 200 https://registry.npmjs.org/bin-version-check 90ms
e[0me[91mnpm e[0me[91mhttp fetch GET 200 https://registry.npmjs.org/download 90ms
e[0me[91mnpm e[0me[91mhttpe[0me[91m e[0me[91mfetche[0me[91m GET 200 https://registry.npmjs.org/import-lazy 83ms
e[0me[91mnpm httpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/os-filter-obj 92ms
e[0me[91mnpm httpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/color-convert 85ms
e[0me[91mnpm httpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/p-try 95ms
e[0me[91mnpm http e[0me[91mfetch GET 200 https://registry.npmjs.org/jsonify 81ms
e[0me[91mnpm e[0me[91mhttp fetche[0me[91m GET 200 https://registry.npmjs.org/array-filter 85ms
e[0me[91mnpm e[0me[91mhttpe[0me[91m fetch GET 200 https://registry.npmjs.org/array-reduce 76ms
e[0me[91mnpm httpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/load-json-file 115ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/array-map 87ms
e[0me[91mnpm http fetche[0me[91m GET 200 https://registry.npmjs.org/es-abstract 80ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/normalize-package-data 87ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/path-type 75ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/globule 79ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz 102ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/has-ansi 101ms
e[0me[91mnpm http fetche[0me[91m GET 200 https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz 99ms
e[0me[91mnpm http e[0me[91mfetch GET 200 https://registry.npmjs.org/fstream 90ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/nopt 114ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/osenv 96ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/semver/-/semver-5.3.0.tgz 102ms
e[0me[91mnpm httpe[0me[91m fetch GET 200 https://registry.npmjs.org/tar 95ms
e[0me[91mnpm http fetche[0me[91m GET 200 https://registry.npmjs.org/aws-sign2 89ms
e[0me[91mnpm httpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/aws4 104ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/caseless 102ms
e[0me[91mnpm httpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/extend 91ms
e[0me[91mnpm httpe[0me[91m fetche[0me[91m GET 200 https://registry.npmjs.org/combined-stream 101ms
....
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz 126ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz 3881ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000934.tgz 2164ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/core-js/-/core-js-2.6.3.tgz 2680ms
e[0me[91mnpm http fetch GET 200 https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz 11817ms
e[0me[91mnpm timing npm Completed in 41761ms
e[0me[91mnpm ERR! cb() never called!
e[0me[91m
npm ERR! This is an error with npm itself. Please report this error at:
npme[0me[91m ERR!     <https://npm.community>
e[0me[91m
e[0me[91mnpm ERR!e[0me[91m A complete log of this run can be found in:
npme[0me[91m ERR!e[0me[91m     /root/.npm/_logs/2019-02-04T17_53_12_844Z-debug.log
e[0mThe command '/bin/sh -c npx npmc@latest install --verbose' returned a non-zero code: 1


For what it’s worth, the exact same application builds on Docker when using node:lts instead of node:lts-alpine. Hopefully that indicates something!


I’ve been digging into this over the past couple hours and have found a way to reliably reproduce the issue (at least on my machine).

Using the gist from the OP, running the following reproduces it 100% of the time for me:

ulimit -n 100
rm -rf node_modules package-lock.json && npm cache clear --force
npm i

https://github.com/npm/cli/blob/59e5056a2129cb2951f4ff3b657ada20657f01a7/lib/install.js#L554 seems to be failing somehow.

What’s really strange is that the exit event is being emitted on process with code set to 0 before that step in the chain finishes, so it’s almost like node is just dropping the queued up work of reading all of the package.json files for each dependency.

I also saw the line above it fail to run to completion once or twice.

I’ll keep digging and see what I can find though…


Thanks for report. Concise reply, because this thread is too long. :slight_smile:

This topic was about “ERR! cb() never called!” with no other failure messages. You have another error (EISDIR), so not actually same issue.

There are multiple open topics about EISIDR with canonical topic. You are first to report issue with npm outdated so I think interesting! I suggest add details there. (Spoiler: likely workaround is changing ownership, avoiding sudo.)

For new replies here with original symptoms despite using npm 6.6 or higher, please note:


Just to clarify this only happens on MacOS X 10.3.4 and up. (tested on 3 machines)
A dev on my team could install this package without problems on windows.


@ktg5 @Portree-Kid @mdrideout @tivrfoa
This topic is overly long and covering many issues, so not a great place to diagnose individual problems. If you need further help, I suggest looking for a topic that was opened more recently that matches your circumstances, or opening a new topic.


Likely pacote 174


Unfortunately this is happening more and more for me, making npm almost unusable.

@zkat I would like to help fixing it. Would you mind recommending some debugging strategy?


It seems to be linked, in our case for little projects it works (not a lot of dependencies). But for larger projects (with a lot of dependencies, it failed).


This error occurs even on the latest release.

CentOS Linux release 7.5.1804

$ node --version
v10.12.0

$ npm --version
6.4.1

npm ERR! cb() never called!


  1. Open package.json
  2. Search for: "gulp": "github:gulpjs/gulp#4.0"
  3. Replace with: "gulp": "^4.0.0"


@churruscat

The issue this topic is about was fixed in npm 6.6.0 and you are running npm 5.0.3, so I suggest you update to a newer version of npm if you are able.

The “ERR! cb() never called!” generally happens after something else goes wrong. The issue this topic turned out to be about was that the underlying error was not being displayed. So npm 6.6.0 and higher may not actually make the install work, but will hopefully tell what the problem is.

If you need more help I suggest you open a new issue, as this topic is long!


Confirming this as the fix:
http://blog.mact.me/2014/10/22/yosemite-upgrade-changes-open-file-limit


Node streams. Again. :weary:


verifying error improvement on canary :+1:

npm@6.6.0

npm ERR! cb() never called!

npmc@latest

npm ERR! EMFILE: too many open files, scandir '/home/user/.npm/_npx/31857'


Continuando la discusión desde [crash] npm ERR! cb() never called!:

What I Wanted to Do

What Happened Instead

Reproduction Steps

Details

Platform Info

$ npm --versions
<!-- paste output here -->
$ node -p process.platform
<!-- paste output here -->