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

Task "lambda_package" not found. #22

Closed
jasonfreier opened this issue Jul 17, 2015 · 7 comments
Closed

Task "lambda_package" not found. #22

jasonfreier opened this issue Jul 17, 2015 · 7 comments

Comments

@jasonfreier
Copy link

After uninstalling and reinstalling dependencies and grunt-aws-lambda 0.8.0, packaging no longer works for me. Prior to this version it was working even with the default empty lambda_package setting in Gruntfile.js.

Grunt 0.4.5
Grunt-Cli 0.1.13
Grunt-aws-lambda 0.8.0

@Tim-B
Copy link
Owner

Tim-B commented Jul 20, 2015

Could you post your Gruntfile.js and package.json? That might help determine whether it's an implementation issue or an issue with the actual plugin.

@jasonfreier
Copy link
Author

Sure thing, pretty basic content.

I've attached both for your review. It seems that part of it is that grunt-cli changed to have deploy be the alias for both package and deploy. Also, even running grunt --help I get errors with "Loading 'Lambda_package.js' tasks..." Looks like it might be having an issue not finding npm as well.

Gruntfile.js

var grunt = require('grunt');
grunt.loadNpmTasks('grunt-aws-lambda');

grunt.initConfig({
    lambda_invoke: {
        default: {
          options: {
            file_name: 'index.js'
          }

        }
    },

lambda_package: {
        default: {
            options: {

            }
        }
    },
});

grunt.registerTask('deploy', ['lambda_package', 'lambda_deploy']);

package.json

{
  "name": "MyLambdaFunction",
  "version": "2.1.0",
  "description": "Description goes here.",
  "main": "index.js",
  "private": "true",
  "dependencies": {
    "aws-sdk": "latest",
    "json-bignum": "^0.0.3",
    "moment": "^2.9.0"
  },
  "devDependencies": {
    "aws-sdk": "latest",
    "grunt": "0.4.*",
    "grunt-pack": "0.1.*",
    "grunt-aws-lambda": "0.1.*",
    "npm": "^2.8.3"

  },
  "bundledDependencies": [
    "json-bignum",
    "moment"
  ]
}

@Tim-B
Copy link
Owner

Tim-B commented Jul 21, 2015

I think "grunt-aws-lambda": "0.1.*", should be "grunt-aws-lambda": "0.8.0", (or another version declaration which 0.8.0 would satisfy) in your package.json.

@timdp
Copy link
Contributor

timdp commented Jul 27, 2015

The issue not finding npm sounds a lot like #20. That one would result in the same sort of errors for me.

@goliatone
Copy link

This issue happens because the task is failing due to an error. It's looking for the npm package and is not found.
If you do npm i npm --save-dev it should fix the issue.

@jasonfreier
Copy link
Author

That would be great if I was on a Linux system, but I’m on windows…and end up with a bunch of nested directories that are almost impossible to get rid of.

From: goliatone [mailto:notifications@github.com]
Sent: Wednesday, July 29, 2015 4:56 PM
To: Tim-B/grunt-aws-lambda grunt-aws-lambda@noreply.github.com
Cc: Jason Freier jason.freier@nativex.com
Subject: Re: [grunt-aws-lambda] Task "lambda_package" not found. (#22)

This issue happens because the task is failing due to an error. It's looking for the npm package and is not found.
If you do npm i npm --save-dev it should fix the issue.


Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-126108158.

@timdp
Copy link
Contributor

timdp commented Jul 30, 2015

@jasonfreier You can upgrade to npm 3, which flattens dependency structures, by running npm i -g npm@3.2.0. Be aware that you'll still need npm 2 as a dependency of grunt-aws-lambda because of #28. (Installing npm 2 locally with a global npm 3 works just fine.)

@Tim-B Tim-B closed this as completed Nov 3, 2015
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

4 participants