无法“npm install aws-lib”

我对AWS非常陌生我开始探索AWS文档,想到从NodeJS应用程序连接AWS sdk,因为我已经安装了npm aws-lib,如下所示。

你能帮我解决这个问题吗?

appss-MacBook-Pro-2:NodeJS apps$ npm install aws-lib aws-lib@0.3.0 node_modules/aws-lib ├── underscore@1.5.2 ├── xml2js@0.1.14 └── sax@0.1.5 appss-MacBook-Pro-2:NodeJS apps$ npm test npm ERR! Darwin 15.0.0 npm ERR! argv "node" "/usr/local/bin/npm" "test" npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! path /Users/apps/Desktop/IOT/NodeJS/package.json npm ERR! code ENOENT npm ERR! errno -2 npm ERR! enoent ENOENT, open '/Users/apps/Desktop/IOT/NodeJS/package.json' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent npm ERR! Please include the following file with any support request: npm ERR! /Users/apps/Desktop/IOT/NodeJS/npm-debug.log appss-MacBook-Pro-2:NodeJS apps$ 

npm-debug.log输出如下:

 0 info it worked if it ends with ok 1 verbose cli [ 'node', '/usr/local/bin/npm', 'test' ] 2 info using npm@2.11.3 3 info using node@v0.12.7 4 verbose stack Error: ENOENT, open '/Users/apps/Desktop/IOT/NodeJS/package.json' 4 verbose stack at Error (native) 5 verbose cwd /Users/apps/Desktop/IOT/NodeJS 6 error Darwin 15.0.0 7 error argv "node" "/usr/local/bin/npm" "test" 8 error node v0.12.7 9 error npm v2.11.3 10 error path /Users/apps/Desktop/IOT/NodeJS/package.json 11 error code ENOENT 12 error errno -2 13 error enoent ENOENT, open '/Users/apps/Desktop/IOT/NodeJS/package.json' 13 error enoent This is most likely not a problem with npm itself 13 error enoent and is related to npm not being able to find a file. 14 verbose exit [ -2, true ] 

你没有安装aws-lib就好了。 您可以通过查看项目目录中的node_modules目录来validation它。

你接下来要做的是调用npm test但看起来你的package.json文件中没有test部分,所以npm不知道要test什么。