Skip to content

"Cannot find module 'npm'" #20

@timdp

Description

@timdp

I use npm@3.1.2. Using grunt-aws-lambda gives me:

Loading "lambda_package.js" tasks...ERROR
>> Error: Cannot find module 'npm'
>>     at Function.Module._resolveFilename (module.js:336:15)
>>     at Function.Module._load (module.js:278:25)
>>     at Module.require (module.js:365:17)
>>     at require (module.js:384:17)
>>     at Object.module.exports (node_modules\grunt-aws-lambda\tasks\lambda_package.js:14:15)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions