Pete.Mertz
Pete.Mertz

Reputation: 1301

Can't use aws-sdk in Meteor

For some reason or another, I can't seem to get the AWS SDK to work in Meteor 0.7.0.1. If I use npm to install, I get the following:

While building the application:
node_modules/aws-sdk/node_modules/xml2js/node_modules/sax/examples/test.html:1: Can't set     DOCTYPE here.  (Meteor sets <!DOCTYPE html> for you)
node_modules/aws-sdk/node_modules/xml2js/node_modules/sax/LICENSE-W3C.html:1: Can't set DOCTYPE here.  (Meteor sets <!DOCTYPE html> for you)
node_modules/aws-sdk/dist/console.html:1: Can't set DOCTYPE here.  (Meteor sets <!DOCTYPE html> for you)
node_modules/aws-sdk/dist/s3upload.html:1: Can't set DOCTYPE here.  (Meteor sets <!DOCTYPE html> for you)
node_modules/aws-sdk/dist/tests.html:1: Can't set DOCTYPE here.  (Meteor sets <!DOCTYPE html> for you)
node_modules/aws-sdk/dist-tools/browser-builder.js:1:15: Unexpected token ILLEGAL

If I install globally (-g flag), I get:

Error: Cannot find module 'aws-sdk'

I have also tried installing meteor-aws-sdk and aws-sdk-npm neither of which seem to work... Currently I'm trying to use the line:

Npm.require( 'aws-sdk' );

to import the module.

Upvotes: 1

Views: 1243

Answers (1)

Tarang
Tarang

Reputation: 75975

You've installed the module using npm. Meteor doesn't support npm modules installed this way. You need to use a wrapper such as the npm package on atmosphere.

You can install aws-sdk using meteorite. There is an up to date package up on atmosphere: https://atmosphere.meteor.com/package/aws-sdk

Upvotes: 2

Related Questions