-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module 'nopt' error while performing NPM install #97
Comments
Maybe. Lets est this. Do you mind trying npm instal node-pre-gyp and then npm instal hummus? |
Thanks for the suggestion. I tried that but it didn't work. As node_pre_gyp is already bundled require won't try to resolve this up the hierarchy - it's the dependencies it will be looking for - mkdirp, nopt e.t.c. Is it possible for the next publish to include the dependant modules? |
look, the package includes node_pre_gyp as a dependency, and it in turn should install the rest. if it doesn't work, i need maybe a new node_pre_gyp, but installing its current dependencies is a bad idea. Gal. |
maybe you have global install of node_pre_gyp? if i'm trying to npm install hummus i can see in node_modules under hummus nopt and the rest. is that not ok? Gal. |
Sorry - not suggesting to install the dependencies explicitly but I believe when using a bundled dependency you need to run npm install on it before publishing. I see this project had a similar issue but got around it by changing from using a bundled Dependency to setting it up as a preinstall instead. Do you need the specify this as a bundled dependency as its already under dependencies? |
Sorry just say you previous comment come in - I'll check that out |
I'm trying to install the latest version (1.0.60) and I'm getting the following error:
node-pre-gyp install --fallback-to-build
module.js:340
throw err;
^
Error: Cannot find module 'nopt'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/tmp/nodejs-services/AService/node_modules/hummus/node_modules/node-pre-gyp/lib/node-pre-gyp.js:14:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
I tried installing earlier versions and 1.0.59 and 1.0.58 give me the same error but 1.0.57 works OK for me.
The issue looks to be that node-pre-gyp is added as a bundled dependency but the published package is missing its node_modules.
version 1.0.57 does come with these bundled:
ls -l ~/.npm/hummus/1.0.57/package/node_modules/node-pre-gyp/node_modules/
total 36
drwxr-xr-x 6 node node 4096 Aug 29 11:04 mkdirp
drwxr-xr-x 7 node node 4096 Aug 29 11:04 nopt
drwxr-xr-x 4 node node 4096 Aug 29 11:04 npmlog
drwxr-xr-x 5 node node 4096 Aug 29 11:04 rc
drwxr-xr-x 4 node node 4096 Aug 29 11:04 request
drwxr-xr-x 3 node node 4096 Aug 29 11:04 rimraf
drwxr-xr-x 4 node node 4096 Aug 29 11:04 semver
drwxr-xr-x 6 node node 4096 Aug 29 11:04 tar
drwxr-xr-x 4 node node 4096 Aug 29 11:04 tar-pack
I think an npm install on the node_pre_gyp package needs to be done before doing an npm publish.
Or am I missing some install step I should be doing?
Thanks,
Ross
The text was updated successfully, but these errors were encountered: