-
Notifications
You must be signed in to change notification settings - Fork 100
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 'npm'" #20
Comments
Hi @timdp, thanks for the report! Can you confirm you're using the latest version of this plugin (ie. 0.8.0)? npm was added to the I also installed NPM 3.1.2 and it seems to be working okay for me. |
Thanks for the quick response! Won't Is there a reason why it's not a regular dependency? |
My understanding is that If you are using the latest version you could try moving it to regular dependencies, I'd be interested to know if that helps. |
Pretty sure that that's not how it works. Installing devDependencies for all dependencies by default would mean a hell of a lot of modules to install. For example, for every module that depends on PhantomJS for browser testing, you'd then unzip PhantomJS again. Particularly with npm 2's non-flattened node_modules folder, you'd waste a lot of disk space on modules that never get used, since you'd never run the tests for your dependencies; that's the author's job. I verified this by just running |
Maybe you're getting confused by how |
Yeah you're right, I was thinking of the situation where the module was being installed directly as opposed to being installed as a dependency. Truth be told I was never able to replicate the issue, however someone submitted a pull request saying adding npm to So does adding npm as a regular dependency help your issue? |
It most likely would. I'm at work now, but I'll test soon. |
I had an issue with this on my Mac, just had to add to my ~/.bash_profile and it worked fine afterwards. |
That sounds like a different issue to me. |
Making npm a regular dependency worked for me. I initially tried with npm@^3.2.0, but that failed. I'll make a new issue for documenting my findings. |
I use npm@3.1.2. Using grunt-aws-lambda gives me:
Looks like
require('npm')
no longer works by default with npm 3.npm i npm@3.1.2
fixes it, so you can probably just include npm in the dependencies. No idea how you would elegantly pass the version of the globally installed npm though. A postinstall hook would work, I guess.The text was updated successfully, but these errors were encountered: