Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Fofry's avatar
Level 6

"npm install" fails with "npm ERR! cb() never called!" on Homestead with NFS

Hi everyone,

When I attempt to run npm install inside a Homestead Vagrant box (6.3.0 + v7.18.0) with type: "nfs" on a freshly cloned Laravel 5.7.9 app, it fails with the following:

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/vagrant/.npm/_logs/2018-10-21T14_32_07_142Z-debug.log

The log file doesn't contain anything useful. The command just fails and gives no more information.

...
22805 timing npm Completed in 667470ms
22806 error cb() never called!
22807 error This is an error with npm itself. Please report this error at:
22808 error <https://npm.community>

VirtualBox (5.2.20-1) is my provider, Vagrant 2.1.5 with the vagrant-bindfs (1.1.0) plugin. Node v10.12.0, npm 6.4.1, Manjaro 18.0.0-rc Illyria.

The important thing is, when I leave out type: "nfs", it works.

I've tried destroying the box and re-provisioning, I've tried updating npm with sudo npm update -g, then npm cache clean --force, then npm install --no-bin-links, also npm install --no-package-lock. I've also tried setting various NFS mount options (['rw,vers=3,udp,nolock,actimeo=2']), all without success.

But then, without NFS, some of my bigger projects get slow as hell, basically unusable (10+ seconds page loads), so NFS is pretty much a must for me.

What do I do, can anyone please confirm this, and/or help? It's driving me insane, I've already wasted half a day attempting to fix this. Running the npm install command from my host of course works, but what's the point of Vagrant then, if I'm required to force other people to setup a local environment.

Thanks in advance for every input!

0 likes
2 replies
Fofry's avatar
Fofry
OP
Best Answer
Level 6

For anyone with the same issue, coming via search: I finally managed to solve this by simply downgrading npm from the 6.x.x version to 5.6.0 version, npm install now works just fine.

You can downgrade npm like so (you might want to put this in your after.sh provisioning script):

sudo npm install -g [email protected]

For Windows you'd need to find and install a specific installer file I guess.

More info on this: https://npm.community/t/crash-npm-err-cb-never-called/858/44

jfeid's avatar

Got the same problem on exactly same configuration (Homestead Vagrant + nfs type) and only downgrading npm solved it. Thanks!

Please or to participate in this conversation.