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

Error with install of npm 3 via Node.js v5 #10166

Closed
Fishrock123 opened this Issue Oct 30, 2015 · 13 comments

Comments

Projects
None yet
@Fishrock123
Contributor

Fishrock123 commented Oct 30, 2015

Jeremiahs-MacBook-Pro:node Jeremiah$ npm i -g branch-diff
Error: Cannot find module './lib'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/node_modules/hawk/index.js:1:80)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "branch-diff"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module './lib'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

Any command does that actually.

Here's my config, printed from npm 2:

Jeremiahs-MacBook-Pro:node Jeremiah$ npm config list
; cli configs
user-agent = "npm/2.14.7 node/v4.2.1 darwin x64"

; userconfig /Users/Jeremiah/.npmrc
email = "fishrock123@rocketmail.com"
prefix = "/Users/Jeremiah/npm"
sign-git-tag = true
tag-version-prefix = "q"

; node bin location = /usr/local/bin/node
; cwd = /Users/Jeremiah/Documents/node
; HOME = /Users/Jeremiah
; 'npm config ls -l' to show all defaults.

I previously did some installing and uninstalling of npm 2 / 3 because of another, maybe related problem where I npm 3 refused to update a global module due to some symlink business. (Where npm 2 didn't care and works.)

@johnsoftek

This comment has been minimized.

Show comment
Hide comment
@johnsoftek

johnsoftek Oct 30, 2015

@Fishrock123 I had the same problem. I removed the /usr/local/lib/node-modules directory and re-installed Node 5.0.0. Fixed the problem.

EDIT You may want to try @clarkorz solution and just remove the /usr/local/lib/node-modules/npm directory. Otherwise, note the packages in /usr/local/node-modules so you can reinstall using npm install -g

johnsoftek commented Oct 30, 2015

@Fishrock123 I had the same problem. I removed the /usr/local/lib/node-modules directory and re-installed Node 5.0.0. Fixed the problem.

EDIT You may want to try @clarkorz solution and just remove the /usr/local/lib/node-modules/npm directory. Otherwise, note the packages in /usr/local/node-modules so you can reinstall using npm install -g

@iwatakeshi

This comment has been minimized.

Show comment
Hide comment
@iwatakeshi

iwatakeshi Oct 30, 2015

@Fishrock123 I can confirm that this is an issue. I just downloaded the latest stable release from releases and copied the contents into /usr/local/lib/node-modules. Also, @johnsoftek 's solution works.

iwatakeshi commented Oct 30, 2015

@Fishrock123 I can confirm that this is an issue. I just downloaded the latest stable release from releases and copied the contents into /usr/local/lib/node-modules. Also, @johnsoftek 's solution works.

@clarkorz

This comment has been minimized.

Show comment
Hide comment
@clarkorz

clarkorz Oct 30, 2015

same here. @johnsoftek 's solution works, but I only removed npm directory under /usr/local/lib/node_modules.

clarkorz commented Oct 30, 2015

same here. @johnsoftek 's solution works, but I only removed npm directory under /usr/local/lib/node_modules.

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Oct 30, 2015

Contributor

This smells like a Node installer issue more than an npm issue, but I'm not sure what's going on. Could one of you (say, @Fishrock123, who's in a position to help us out with this on the Node side) open up a tracking issue on nodejs/node so we can start working together to figure out how to resolve this?

Neither @iarna nor I have seen this behavior when using npm to upgrade itself, and Fishrock's stacktrace makes no sense to either of us, because hawk isn't at that path in the version of npm we downstreamed to Node.

Thanks to everyone for providing us with the details you have thus far. Seems like it'll probably be a pretty quick turnaround to getting Node 5.0.1 out the door. 😦

Contributor

othiym23 commented Oct 30, 2015

This smells like a Node installer issue more than an npm issue, but I'm not sure what's going on. Could one of you (say, @Fishrock123, who's in a position to help us out with this on the Node side) open up a tracking issue on nodejs/node so we can start working together to figure out how to resolve this?

Neither @iarna nor I have seen this behavior when using npm to upgrade itself, and Fishrock's stacktrace makes no sense to either of us, because hawk isn't at that path in the version of npm we downstreamed to Node.

Thanks to everyone for providing us with the details you have thus far. Seems like it'll probably be a pretty quick turnaround to getting Node 5.0.1 out the door. 😦

@vitaly-t

This comment has been minimized.

Show comment
Hide comment
@vitaly-t

vitaly-t Oct 30, 2015

This won't help, but I'm installing Node 5.0.0 using the UI on a Windows 10 machine, and it doesn't upgrade my NPM, which is still sitting at 2.6.0

vitaly-t commented Oct 30, 2015

This won't help, but I'm installing Node 5.0.0 using the UI on a Windows 10 machine, and it doesn't upgrade my NPM, which is still sitting at 2.6.0

@DominicTobias

This comment has been minimized.

Show comment
Hide comment
@DominicTobias

DominicTobias Oct 30, 2015

Thanks @johnsoftek @clarkorz, removing npm and reinstalling fixed the issue for me too

DominicTobias commented Oct 30, 2015

Thanks @johnsoftek @clarkorz, removing npm and reinstalling fixed the issue for me too

@stevenvachon

This comment has been minimized.

Show comment
Hide comment
@stevenvachon

stevenvachon Oct 30, 2015

@clarkorz ditto. Thanks all.

stevenvachon commented Oct 30, 2015

@clarkorz ditto. Thanks all.

@wesbos

This comment has been minimized.

Show comment
Hide comment
@wesbos

wesbos Oct 30, 2015

I also had this issue - fixed with deleting /usr/local/lib/node_modules/npm and reinstalling node 5.0.0

wesbos commented Oct 30, 2015

I also had this issue - fixed with deleting /usr/local/lib/node_modules/npm and reinstalling node 5.0.0

@Fishrock123

This comment has been minimized.

Show comment
Hide comment
@Fishrock123

Fishrock123 Oct 30, 2015

Contributor

Note: this happened even though my npm is explicitly configured to use /Users/Jeremiah/npm rather than /usr/local/lib/node_modules for global modules.

Contributor

Fishrock123 commented Oct 30, 2015

Note: this happened even though my npm is explicitly configured to use /Users/Jeremiah/npm rather than /usr/local/lib/node_modules for global modules.

@Fishrock123

This comment has been minimized.

Show comment
Hide comment
@Fishrock123

Fishrock123 Oct 30, 2015

Contributor

Hmm, possible origin: nodejs/node@63a628d#diff-649abfdda4cfccbe318266e0c9116701L3

Digging but it may be that the above commit in node did not land correctly or was previously missed in v4.0.0.

Contributor

Fishrock123 commented Oct 30, 2015

Hmm, possible origin: nodejs/node@63a628d#diff-649abfdda4cfccbe318266e0c9116701L3

Digging but it may be that the above commit in node did not land correctly or was previously missed in v4.0.0.

@christianhaller

This comment has been minimized.

Show comment
Hide comment
@christianhaller

christianhaller commented Nov 2, 2015

@wesbos thx

@Fishrock123

This comment has been minimized.

Show comment
Hide comment
@Fishrock123

Fishrock123 Nov 3, 2015

Contributor

Closing, this is a node installer issue. It will probably stay like this for now, but won't change like this in the future.

Contributor

Fishrock123 commented Nov 3, 2015

Closing, this is a node installer issue. It will probably stay like this for now, but won't change like this in the future.

@Fishrock123 Fishrock123 closed this Nov 3, 2015

@Riokai

This comment has been minimized.

Show comment
Hide comment
@Riokai

Riokai Nov 5, 2015

@johnsoftek It's work for me! Thanks

Riokai commented Nov 5, 2015

@johnsoftek It's work for me! Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.