Skip to content
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 './src/common' only in npm version 2 #46

Closed
ZeroCho opened this issue Aug 16, 2016 · 6 comments
Closed

Cannot find module './src/common' only in npm version 2 #46

ZeroCho opened this issue Aug 16, 2016 · 6 comments

Comments

@ZeroCho
Copy link

ZeroCho commented Aug 16, 2016

I recently changed npm version from 3 to 2 in order to use google app engine.
I could successfully install packages when i was using npm3, but after i changed to npm2, this error happens. I don't use this package directly. It is installed via dependencies of postcss-cssnext.

I think it's related to the way npm installs packages. I heard that npm3 differently installs its packages than npm2.

> [email protected] postinstall C:\Users\ZeroCho\WebstormProjects\zerocho-home\node_modules\caniuse-api
> node generator.js

module.js:338
    throw err;
    ^

Error: Cannot find module './src/common'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\Users\ZeroCho\WebstormProjects\zerocho-home\node_modules\shelljs\shell.js:9:14)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

and the strange thing is, after failing npm install, I tried to run that command again, then it succeeded. First install always fails and second install succeeds.

@ZeroCho
Copy link
Author

ZeroCho commented Aug 16, 2016

@MoOx i have above error with caniuse-api which is a dependency of postcss-cssnext. I found many issues related to caniuse-api in postcss-cssnext repository. Do you think is this one of them?

@MoOx
Copy link
Collaborator

MoOx commented Aug 16, 2016

There is no such file as src/common. The issue seems to be a shelljs issue.

@ZeroCho
Copy link
Author

ZeroCho commented Aug 16, 2016

@MoOx Thank you! I'll make an issue at that repository

@ZeroCho
Copy link
Author

ZeroCho commented Aug 16, 2016

Additional error message

Linux 3.16.0-4-amd64
npm ERR! argv "/usr/local/nvm/versions/node/v4.1.2/bin/node" "/usr/local/nvm/versions/node/v4.1.2/bin/npm" "i" "--production"
npm ERR! node v4.1.2
npm ERR! npm  v2.14.4
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node generator.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'node generator.js'.
npm ERR! This is most likely a problem with the caniuse-api package,
npm ERR! not with npm itself.
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node generator.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls caniuse-api
npm ERR! There is likely additional logging output above.

@MoOx
Copy link
Collaborator

MoOx commented Aug 16, 2016

Sorry the this message doesn't help at all. Nothing is interesting here...

@MoOx
Copy link
Collaborator

MoOx commented Sep 5, 2016

Should be closed by #47

@MoOx MoOx closed this as completed Sep 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants