不能在Meteor中使用aws-sdk

[英]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:

出於某種原因,我似乎無法讓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

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

如果我全局安裝(-g標志),我得到:

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:

我也嘗試過安裝meteor-aws-sdk和aws-sdk-npm這些似乎都不起作用......目前我正在嘗試使用該行:

Npm.require( 'aws-sdk' );

to import the module.

導入模塊。

1 个解决方案

#1


2  

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.

您已使用npm安裝了該模塊。 Meteor不支持以這種方式安裝的npm模塊。您需要在大氣層上使用包裝,例如npm包。

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

你可以使用隕石安裝aws-sdk。有一個最新的氣氛包:https://atmosphere.meteor.com/package/aws-sdk


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2014/01/10/72f90d56a5a79df4538f5a3a2eb79932.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com