Skip to content
This repository has been archived by the owner. It is now read-only.

npm install: "cb() never called" #17839

Open
daaang opened this issue Jul 18, 2017 · 34 comments

Comments

@daaang
Copy link

commented Jul 18, 2017

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • Other: the error output specifically asked me to report it, and I couldn't find a duplicate.

What's going wrong?

My local npm install was working until today, but now it will not install anything. It complains of a nonpermitted cross-device link and that cb() is never called.

Note: I've replaced some specific paths with $HOME and $PREFIX to avoid cluttering this up with my environment details. The important points are that (a) I don't have root access to this machine, (b) this is a local install of node and npm, and (c) $HOME and $PREFIX exist on different drives.

$ npm install -g npm
Unhandled rejection Error: EXDEV: cross-device link not permitted, link '$HOME/.npm/_cacache/tmp/1e1355d4' -> '$HOME/.npm/_cacache/content-v2/sha512/5f/2f/6e5e5a0ff8659ca768818b2df10c2ab7fc31aa78fd9021c02dd7f0f0caf3f5af4a6b1ba7d16461e48bd4af27ba3093ddec8ad50e07c80bb750978996030e'

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!     $HOME/.npm/_logs/2017-07-18T18_47_25_614Z-debug.log
$ cat $HOME/.npm/_logs/2017-07-18T18_47_25_614Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '$PREFIX/bin/node',
1 verbose cli   '$PREFIX/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'npm' ]
2 info using npm@5.0.3
3 info using node@v8.1.4
4 verbose npm-session 18d332a1a9f815ac
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 error cb() never called!
8 error This is an error with npm itself. Please report this error at:
9 error <https://github.com/npm/npm/issues>

How can the CLI team reproduce the problem?

I've completely uninstalled, recompiled, and reinstalled node, and this still happens. My installation procedure looked like this:

$ wget 'https://nodejs.org/dist/v8.1.4/node-v8.1.4.tar.gz'
$ tar xzf node-v8.1.4.tar.gz
$ cd node-v8.1.4/
$ ./configure --prefix=$PREFIX
$ make
$ make install

To be clear, this error appears no matter what I try and install, regardless of whether I add the -g flag.

supporting information:

  • npm -v prints: 5.0.3
  • node -v prints: v8.1.4
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Debian GNU/Linux 8.8 (jessie) (3.16.0-4-amd64)
  • Network issues: N/A
  • Container: N/A
@beansprout

This comment has been minimized.

Copy link

commented Jul 20, 2017

I get very similar error messages except I am trying to update using homebrew.
I ran this: brew update && brew upgrade node && npm update -g npm

Updating homebrew produced no issues. This printed after the updating:

 Upgrading 1 outdated package, with result:
node 8.2.0
==> Upgrading node
==> Downloading https://homebrew.bintray.com/bottles/node-8.2.0.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring node-8.2.0.sierra.bottle.tar.gz
==> Using the sandbox
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/node/8.2.0: 4,151 files, 45.9MB
Unhandled rejection Error: ENOENT: no such file or directory, stat '/Users/brew/Library/Caches/Homebrew/node--npm-5.3.0.tgz'

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/christopher/.npm/_logs/2017-07-20T04_15_39_033Z-debug.log

(Note) I ended up installing the updates with the mac install pkg which installed fine.

@nunoarruda

This comment has been minimized.

Copy link

commented Jul 20, 2017

Similar issue here when trying to list outdated packages:

Nunos-MacBook-Pro:~ nunoarruda$ npm outdated -g
Unhandled rejection Error: ENOENT: no such file or directory, stat '/Users/brew/Library/Caches/Homebrew/node--npm-5.3.0.tgz'

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/nunoarruda/.npm/_logs/2017-07-20T11_38_56_077Z-debug.log
Nunos-MacBook-Pro:~ nunoarruda$ node -v
v8.2.0
Nunos-MacBook-Pro:~ nunoarruda$ npm -v
5.3.0
@j2l

This comment has been minimized.

Copy link

commented Jul 20, 2017

Same here,
And cache clean --force before didn't fix it:

> npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.

>npm update
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>

EDIT: fix in #17222 worked for me:
npm i -g MODULE
npm un -g MODULE
npm i -g MODULE (again)

@kenashworth

This comment has been minimized.

Copy link

commented Jul 20, 2017

This was working (I think) before I homebrew updated node to 8.2.0.sierra.

@kenashworth

This comment has been minimized.

Copy link

commented Jul 20, 2017

interestingly, my error has Unhandled rejection Error: ENOENT: no such file or directory, stat '/Users/Users/brew/Library... (double Users) when run from not ~.

@amyspark amyspark referenced this issue Jul 21, 2017
1 of 13 tasks complete
@daaang

This comment has been minimized.

Copy link
Author

commented Jul 21, 2017

As long as I install a version of node bundled with a version of npm less than 5, npm works as I'd expect it to. I can even run npm i -g npm, but, if I do, it will be npm's last successful run.

I can make do with npm 4.1.2 until this gets fixed, though. In the meantime, I'd be happy to test-run things and report on them, if anybody's having trouble reproducing this.

@nunoarruda

This comment has been minimized.

Copy link

commented Jul 21, 2017

I'm no longer experiencing this issue with Node v8.2.1, not sure if/how is it related.

@marcoose777

This comment has been minimized.

Copy link

commented Jul 25, 2017

Me too,
Just started today. Daangs suggestion cleared one of the errors up with the package semver, but the apm(atom package manager) problem is persistent(see bellow).

Versions:
[me@home ~]$ apm -v
(node:3450) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.(?!)
apm 1.18.2
npm 5.3.0
node 8.1.4 x64
python 2.7.13
git 2.13.3

[me@home ~]npm -g update
Unhandled rejection Error: ENOENT: no such file or directory, open '/apm-1.18.2/package.json'
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! /root/.npm/_logs/2017-07-25T17_36_12_356Z-debug.log

/root/.npm/_logs/ file:

info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'update', '-g' ]
2 info using npm@5.3.0
3 info using node@v8.1.4
4 verbose npm-session dfcaeb3411f026dc
5 silly mapToRegistry name atom-package-manager
...
64 verbose headers 'x-cache-hits': '3',
64 verbose headers 'x-timer': 'S1501002708.934517,VS0,VE0',
64 verbose headers vary: 'Accept-Encoding, Accept' }
65 error cb() never called!
66 error This is an error with npm itself. Please report this error at:
67 error https://github.com/npm/npm/issues

@MMayla

This comment has been minimized.

Copy link

commented Aug 6, 2017

I have the same problem as @marcoose777

sudo npm -g update

Unhandled rejection Error: ENOENT: no such file or directory, stat '/home/me/node_modules/atom-package-manager/atom-package-manager-1.18.3.tgz'

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!     /root/.npm/_logs/2017-08-06T10_55_33_657Z-debug.log

apm -v

apm  1.18.3
npm  5.3.0
node 8.2.1 x64
python 2.7.13
git 2.13.3
@jfahrenkrug

This comment has been minimized.

Copy link

commented Sep 13, 2017

I also get this on OS X 10.12.6 with node 8.5 and npm 5.3.
Running npm outdated triggers it for me.

@legodude17

This comment has been minimized.

Copy link
Contributor

commented Sep 14, 2017

Does this occur with the latest npm?

@jfahrenkrug

This comment has been minimized.

Copy link

commented Sep 14, 2017

@legodude17 Yes, I just updated to 5.4.1 and it still happens.

@jwuliger

This comment has been minimized.

Copy link

commented Sep 15, 2017

Hello, I have been having this exact same issue myself on 5.4.1 and 5.4.2. Any solutions or workarounds? Thanks!

@jfahrenkrug

This comment has been minimized.

Copy link

commented Sep 19, 2017

It's fixed for me in 5.4.2.

@jeroenouw

This comment has been minimized.

Copy link

commented Sep 23, 2017

@jfahrenkrug Did a lot but nothing works, npm v5.4.2 finally solved the problem!

@2012215434

This comment has been minimized.

Copy link

commented Dec 13, 2017

The problem still happen in npm v5.6.0!

@digitalhemanth

This comment has been minimized.

Copy link

commented Dec 14, 2017

npm WARN tar zlib error: unexpected end of file
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! C:\Users\hemanth\AppData\Roaming\npm-cache_logs\2017-12-14T11_25_1
8_974Z-debug.log
Package install failed, see above.
Package install failed, see above.

@wkhutchi

This comment has been minimized.

Copy link

commented Dec 14, 2017

Here is the fix I used:
Uninstall node.js
Delete the folders:
C:\Users\AppData\Roaming\npm
C:\Users\AppData\Roaming\npm-cache
Reinstall node.js
Do another "npm install".

@digitalhemanth

This comment has been minimized.

Copy link

commented Dec 18, 2017

@wkhutchi thank you now its working .

@wkhutchi

This comment has been minimized.

Copy link

commented Dec 18, 2017

I'm glad you got it working. Thanks for letting me know you did.

@muttalipkucuk

This comment has been minimized.

Copy link

commented Feb 5, 2018

Version npm: 5.6.0
Version node: v8.9.4

None of these commands work for me.

@bennettellis

This comment has been minimized.

Copy link

commented Feb 13, 2018

@wkhutchi solution worked for me, but slightly simplified. I only deleted the ...Roaming\npm and ...\Roaming\npm-cache directories then re-ran my npm i and it seems to have fixed the issue for me.

nmp: v5.6.0
node: v8.9.4

@wkhutchi

This comment has been minimized.

Copy link

commented Feb 13, 2018

Nice. Thanks for sharing your short cut.

@MahendranShanmugam

This comment has been minimized.

Copy link

commented Feb 16, 2018

Hi wkhutchi,
I deleted the folder and reinstalled the nodejs but now also i am getting above error give some solution please.

@wkhutchi

This comment has been minimized.

Copy link

commented Feb 16, 2018

Mahendran Shanmugam,

I'm just a fellow developer like you. I tried to fix this problem on my PC for about two weeks (including moving from Windows 7 to Windows 10). The internet had no solution. Those who did find a fix did not post their solution. So, I posted my solution. Try my steps again maybe reboot between might help?

Maybe?
Uninstall node.js
Reboot
Delete the folders:
C:\Users\ YOUR LOGIN NAME \AppData\Roaming\npm
C:\Users\ YOUR LOGIN NAME \AppData\Roaming\npm-cache
Maybe look for other npm folders under AppData and delete them too?
Reboot
Reinstall node.js
Do another "npm install".

Good Luck!!!

And when you find your solution, please post it for others to find.

Thanks,
wkhutchi

@MahendranShanmugam

This comment has been minimized.

Copy link

commented Feb 16, 2018

Hi wkhutchi ,

I got solution. I uninstalled the old version of nodejs and now i installed the new version of nodejs and also followed your steps now it is working fine. Thank you so much @wkhutchi.

Thanks and Regards,
Mahendran Shanmugam.

@alaaeddinezammel

This comment has been minimized.

Copy link

commented Feb 22, 2018

For which version of npm and node installed by you ! @wkhutchi & @MahendranShanmugam

@padurets

This comment has been minimized.

Copy link

commented Apr 11, 2018

I had the same problem after run npm i
it helped me:

rm -rf node_modules
npm i "any package"

it is important to specify the name of any package, otherwise npm falls

@mystikraz

This comment has been minimized.

Copy link

commented May 19, 2018

any package? which package?

@padurets

This comment has been minimized.

Copy link

commented May 19, 2018

@mystikraz "any package" that you have in the dependencies in the package.json

@iuliuvisovan

This comment has been minimized.

Copy link

commented May 26, 2018

The solution that worker for me (npm 5.3.0):

  1. Delete the C:/Users/{you}/AppData/Roaming/npm folder.
  2. Delete the C:/Users/{you}/AppData/Roaming/npm-cache folder.

Re-run npm install.

@zhangbg

This comment has been minimized.

Copy link

commented Jun 1, 2018

My solution is here:

npm cache clear --force
npm install --force

@Kadgiko

This comment has been minimized.

Copy link

commented Jul 5, 2018

I have the same issue with
node v10.6.0
npm v6.1.0

I tried other mentionned solutions

  1. Clear cache and re-install

npm cache clear --force
npm install --force

  1. Clear npm folders and re-install

Delete the C:/Users/{you}/AppData/Roaming/npm folder.
Delete the C:/Users/{you}/AppData/Roaming/npm-cache folder.

  1. Delete local node_modules folder

  2. Downgrade to npm 5.10.0 and 4

  3. Downgrade to node 10.3.0

6. Deleted package-lock.json has worked for me

@johntran

This comment has been minimized.

Copy link

commented Jul 9, 2018

Updating to Mac OS X High Sierra w/ Node 10.5.0 and npm 6.1.0 worked for me.

I was originally OS X Sierra w/ Node 8.9.0 and npm 6.1.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
You can’t perform that action at this time.