Repository navigation
Error: Cannot find module './lib' #3606
Description
Activity
Can you paste the entire stack trace?
Reacted by BenHenderson09Error: 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" 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>Reacted by BenHenderson09ref. npm/npm#10166
- addedconfirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.npmIssues and PRs related to the npm client dependency or the npm registry.Issues and PRs related to the npm client dependency or the npm registry.
on Oct 30, 2015 I think it probably has something to do with https://github.com/nodejs/node/blob/master/tools/osx-pkg.pmdoc/02npm.xml#L9 but I don't actually understand how OS X installers work. cc @othiym23
Hmmm, could 63a628d#diff-649abfdda4cfccbe318266e0c9116701L3 have been this issue? That commit was scheduled for v4.0.0 but doesn't seem to have landed until v5?
+1 same os version and 5.0.0.
Can't reproduce with 4.2.1Reacted by Jeremy Banks, sw-tt-bhoomijagani and Éder CostaOn second look, that seems like just an identifier though...
cc @nodejs/build for anyone who knows how the OS X installer works more
@nicolabortignon ... I just want to be clear: you are not seeing this problem with
v4.2.1currently correct?@jasnell I did not have any issues with v4.2.1
From #npm irc:
othiym23: Fishrock123: yes, but if the installer only uninstalls the previous version before installing the new version if the manifest IDs match, that would account for the behavior everyone's seeing
@jasnell that is correct, 4.2.1 works like a charm.
Reacted by pengyanb46 remaining items
Is this still an issue?
@jasnell Unless the installer has been updated to remove
/usr/local/lib/node_modules/npmduring install this will continue to be an issue any time the shape of thenpmdependency tree changes. Currently we are maintaining an npm@2 style tree in npm@3, which only changes shape very rarely, but at some point (when we drop support for 0.8) I would like to see us switch to an npm@3 style tree (that is, flat, fully deduped), but we can't w/o the installer fix as it will break anyone updating (remember 3.3.6?, ugh).@iarna there is a PR open to change the installer (for osx at least)
--> #5656
It includes a commit to remove npm during install --> eff981b
I had done some work in a branch to try and getting a script working to do this with the current installer but couldn't get it working. I plan to dig into it again, but it might not be a good use of time if the other PR is ready to land
Is this still an issue?
... yep.
Reacted by Myles Borins, Julián Duque and María Alejandra Gómez C.plz fix my bug as soon as possible
@amodkumar57 your problems look unrelated to this issue, which is about npm not working.
Can you post over at http://github.com/nodejs/help with more information about the problem you are having
I don't have a node_modules folder in
/usr/local/lib/on ubuntu 14.04.. but I do have node and npm running and getting this error. Any ideas in this case? I uninstalled node and reinstalled and got the same thing.parallels@ubuntu:~/Documents/nikebot$ node -v v4.4.7 parallels@ubuntu:~/Documents/nikebot$ npm -v 2.15.8Error: Cannot find module './lib/' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (/home/parallels/Documents/nikebot/node_modules/mongoose/index.js:7:18) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17)Same issue when I run phonegap run ios
Output :
module.js:340
throw err; ^Error: Cannot find module './lib/run'
had this exact issue on Ubuntu bash in windows. Deleting the given folder worked perfect.
how to do centos
This issue has been inactive for sufficiently long that it seems like perhaps it should be closed. Feel free to re-open (or leave a comment requesting that it be re-opened) if you disagree. I'm just tidying up and not acting on a super-strong opinion or anything like that.
- Delete node modules
- Delete package-lock.json
- Run npm install --legacy-peer-deps
- Run npm start
Reacted by Jhobanny Morillo and NaN



Just installed node v5 and running
npmin command line produces said error.OS X 10.10.5
How to Fix
(For now)
(Edited in by @Fishrock123)