由于某种原因,我似乎无法让 AWS SDK 在 Meteor 0.7.0.1 中工作。如果我使用 npm 安装,我会得到以下信息:
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
如果我全局安装(-g 标志),我会得到:
Error: Cannot find module 'aws-sdk'
我还尝试安装meteor-aws-sdk和aws-sdk-npm,但这两个似乎都不起作用......目前我正在尝试使用该行:
Npm.require( 'aws-sdk' );
导入模块。
最佳答案
您已使用 npm
安装了该模块。 Meteor 不支持以这种方式安装的 npm 模块。您需要使用包装器,例如大气上的 npm
包。
您可以使用陨石安装aws-sdk
。有一个最新的大气包:https://atmosphere.meteor.com/package/aws-sdk
关于node.js - 无法在 Meteor 中使用 aws-sdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21051558/