claudiajs / example-projects

Simple example projects that show how to use ClaudiaJs
650 stars 235 forks source link

s3-file-processing won't work - aws-sdk dependency is missing locally #10

Closed robfe closed 8 years ago

robfe commented 8 years ago
XXX> npm start

> s3-file-procesing@ start XXX
> claudia create --name s3-processing --region us-east-1 --handler main.handler

validating package
Error: Cannot find module 'aws-sdk'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
...

I guess the fix is to either suggest manually installing the aws-sdk, or add it to packages.json? If it was clear to me which one i could send a PR

aidanbon commented 8 years ago

I went into the same issue earlier. From what I know, 2 workarounds:

  1. add aws-sdk to package.json "dependencies"
  2. manually npm i aws-sdk and during claudia create / update, add the --use-local-dependencies flag, this may include other stuff (e.g. devDependencies) into the lambda.

Not sure there are other better options. I used option 1 above.

gojko commented 8 years ago

aws-sdk should be, according to the docs, provided by lambda anyway. if they stopped doing it, i'll just add aws-sdk to dependencies

robfe commented 8 years ago

I think it still is, but that doesn't help Claudia build the package locally

On 22/09/2016, at 7:24 PM, Gojko Adzic notifications@github.com wrote:

aws-sdk should be, according to the docs, provided by lambda anyway. if they stopped doing it, i'll just add aws-sdk to dependencies

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

gojko commented 8 years ago

@robfe thanks for reporting this, it's fixed now