chilts / awssum

(deprecated: use aws-sdk) Node.js modules for talking to lots of Web Service APIs.
Other
462 stars 57 forks source link

Error: Cannot find module './amazon/amazon' #157

Closed pgray007 closed 11 years ago

pgray007 commented 11 years ago

As of the latest version of awssum I now get the above error. Here's the rest of the stack trace:

Error: Cannot find module './amazon/amazon' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:362:17) at require (module.js:378:17) at Object.load (/var/lib/stickshift/8337b3ac66644f3a9ea607c791ac90c4/app-root/data/225797/node_modules/awssum/awssum.js:43:12)

chilts commented 11 years ago

Which version of AwsSum are you using?

I've just published v1.0.0-alpha which breaks up AwsSum into a plugin architecture so it might be related to that.

Thanks.

pgray007 commented 11 years ago

Yes, it was on 1.0.0-alpha. I reverted to 0.9.0 and all is well.

chilts commented 11 years ago

So to finish, for v0.12.2 you should pin your version to this in your package.json.

For the newer module you should put the end service into your package.json. e.g. if you want to use S3, then you should depend on awssum-amazon-s3. Both awssum and awssum-amazon will be pulled in correctly in that case.

inadarei commented 11 years ago

Um, to clarify this issue further, this is what should be in package.json if you are using say S3 and SQS modules:

, "dependencies": {
    "awssum"            : "1.x"
  , "awssum-amazon-sqs" : "1.x"
  , "awssum-amazon-s3": "1.x"
  }

AND this is how you should initialize variables, INSTEAD of what current documentation at awssum.io tells you about module.load() thingie:

var awssum = require('awssum')
    , amazon = require('awssum-amazon')
    , S3 = require('awssum-amazon-s3').S3;
    , Sqs = require('awssum-amazon-sqs').Sqs;
iamwilhelm commented 11 years ago

@inadarei Defn thanks for the clarification. It saved me a bunch of time. However, I take it that the S3 line is a typo. It should probably read:

, S3 = require('awssum-amazon-s3').S3;

The require file is wrong in your example, I believe.

inadarei commented 11 years ago

@iamwilhelm you are absolutely correct. Sorry for the copy/paste typo and thanks for catching it. I updated my original example.

Cheers.