I am using aws-sdk on Server side to delete some data from S3. I have added the npm module in my project using meteor npm install --save 'aws-sdk'
in my project. My package.json shows “aws-sdk”: “^2.5.4” as a dependency. Everything works fine in my method ‘deleteImageFromS3’ when I run on localhost. I checked it successfully deletes the image from S3 bucket.
But when I deploy my app on galaxy servers from meteor and I get following error in the logs:
2016-08-31 14:04:02+05:30Exception while invoking method 'deleteImageFromS3' Error: Cannot find module 'aws-sdk'
8j2j
2016-08-31 14:04:02+05:30 at Function.Module._resolveFilename (module.js:325:15)
8j2j
2016-08-31 14:04:02+05:30 at Function.Module._load (module.js:276:25)
8j2j
2016-08-31 14:04:02+05:30 at Module.require (module.js:353:17)
8j2j
2016-08-31 14:04:02+05:30 at require (internal/module.js:12:17)
8j2j
2016-08-31 14:04:02+05:30 at Object.Npm.require (/app/bundle/programs/server/boot.js:166:18)
8j2j
2016-08-31 14:04:02+05:30 at Object.Meteor.npmRequire (packages/npm-container/index.js:2:1)
8j2j
2016-08-31 14:04:02+05:30 at [object Object].deleteImageFromS3 (server/startup/server.js:111:22)
What do I need to do to install aws-sdk on galaxy meteor hosting? I suppose meteor should have taken care of this while building the package before deploying it to meteor hosted galaxy servers. I am using:
@ffxsam I followed your steps and my code works in a fresh install. I was able to delete the image and no error was found related to missing ‘aws-sdk’. My problem persists - still getting Cannot find module 'aws-sdk’ on Galaxy.
Already asked the support - their response time is 2 working days. I see successful installation commands and final message that ‘Successfully built the application’. The moment my deleteImageFromS3 method runs it throws error - Cannot find module ‘aws-sdk’
2016-08-31 14:27:18+05:30 ---> aa62fc7a886a
v004
2016-08-31 14:27:19+05:30Removing intermediate container c7e95c0e708a
v004
2016-08-31 14:27:19+05:30Successfully built aa62fc7a886a
v004
2016-08-31 14:27:19+05:30Pushing image to Galaxy's Docker registry.
v004
2016-08-31 14:27:39+05:30Cleaning up.
v004
2016-08-31 14:27:40+05:30Successfully built version 4.
eza2
2016-08-31 14:28:01+05:30Application process starting, version: 4 on apprunner (embedded)
8j2j
2016-08-31 14:28:18+05:30Exception while invoking method 'deleteImageFromS3' Error: Cannot find module 'aws-sdk'
8j2j
2016-08-31 14:28:18+05:30 at Function.Module._resolveFilename (module.js:325:15)
8j2j
2016-08-31 14:28:18+05:30 at Function.Module._load (module.js:276:25)
8j2j
2016-08-31 14:28:18+05:30 at Module.require (module.js:353:17)
8j2j
2016-08-31 14:28:18+05:30 at require (internal/module.js:12:17)
8j2j
2016-08-31 14:28:18+05:30 at Object.Npm.require (/app/bundle/programs/server/boot.js:166:18)
8j2j
2016-08-31 14:28:18+05:30 at Object.Meteor.npmRequire (packages/npm-container/index.js:2:1)
8j2j
2016-08-31 14:28:18+05:30 at [object Object].deleteImageFromS3 (server/startup/server.js:111:22)
8j2j
2016-08-31 14:28:18+05:30 at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1711:12)
8j2j
2016-08-31 14:28:18+05:30 at packages/ddp-server/livedata_server.js:711:19
8j2j
2016-08-31 14:28:18+05:30 at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
8j2j
Likely: It is because this package was for Meteor 1.2:
Now you don’t need it anymore because Meteor now has support for NPM by itself. So you can also remove the meteorhacks:npm package you have been using before.