Skip to content

Error in lambda_package.js #39

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

Closed
shawlz opened this issue Oct 10, 2015 · 5 comments
Closed

Error in lambda_package.js #39

shawlz opened this issue Oct 10, 2015 · 5 comments

Comments

@shawlz
Copy link

shawlz commented Oct 10, 2015

Hi,
Thanks for this lovely plugin.

I have an error with running lambda_package I debugged and found that

grunt-aws-lambda/tasks/lambda_package.js Line 66:
npm.commands.install(install_location, options.package_folder , function () {

returns the follow error

Fatal error: Argument #2: Expected array but got string

When I change it to
npm.commands.install(install_location, [options.package_folder] , function () {

It works but I get the follow warnings
npm WARN ENOENT ENOENT, open '/private/var/folders/4r/9q6tv2_55257mkv4t9l7d4xw0000gn/T/1444468471486.175/package.json'
npm WARN EPACKAGEJSON /var/folders/4r/9q6tv2_55257mkv4t9l7d4xw0000gn/T/1444468471486.175 No description
npm WARN EPACKAGEJSON /var/folders/4r/9q6tv2_55257mkv4t9l7d4xw0000gn/T/1444468471486.175 No repository field.
npm WARN EPACKAGEJSON /var/folders/4r/9q6tv2_55257mkv4t9l7d4xw0000gn/T/1444468471486.175 No README data
npm WARN EPACKAGEJSON /var/folders/4r/9q6tv2_55257mkv4t9l7d4xw0000gn/T/1444468471486.175 No license field.

Any ideas how to fix it? My package.json file is

{
"name": "lambda-local",
"version": "1.0.0",
"description": "SMS Processor",
"main": "index.js",
"private": "true",
"dependencies": {
"aws-sdk": "^2.2.9",
"mysql": "^2.9.0",
"node-uuid": "^1.4.3",
"npm": "^3.1.2",
"request": "^2.64.0"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-pack": "0.1.*",
"grunt-aws-lambda": "^0.8.0"
},
"license": "ISC",
"bundledDependencies": [
"aws-sdk",
"mysql",
"node-uuid",
"request"
]
}

@shawlz shawlz changed the title Error on lambda_package.js Error in lambda_package.js Oct 11, 2015
@janua
Copy link

janua commented Oct 23, 2015

@sajayi I have just had this same issue.
I ended up upgrading my node, grunt and grunt-cli to the latest version. It also required me to remove the node_modules and start again. It worked then.

@shawlz
Copy link
Author

shawlz commented Oct 23, 2015

@janua Thanks for your feedback. Will try it out.

@peterfox
Copy link

Getting this problem and really don't know why, even tried @janua advice and didn't seem to help? What version numbers do people have?

@asherr
Copy link

asherr commented Jan 12, 2016

@sajayi @peterfox The issue is that npm.commands.install changed in a recent version of npm. @sagivo and I found that adding

"npm": "^2.10.0"

to the devDependencies in your package.json and rerunning npm install will fix the issue

@sagivo
Copy link

sagivo commented Jan 12, 2016

yep. can verify that this solution works. may close the ticket.

@Tim-B Tim-B closed this as completed Feb 14, 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

6 participants