AWS Linux,Docker容器获取npm启动

这里所有这些都是新鲜的,

试图让docker运行在单个节点上运行我的JavaScript应用程序。

find这个AWS文章来安装npm: http : //docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html

运行以下命令:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash . ~/.nvm/nvm.sh nvm install 6.11.5 node -e "console.log('Running Node.js ' + process.version)" 

然后开始按照这个指南创build一个应用程序来testing: https : //medium.com/@sunnykay/docker-development-workflow-node-express-mongo-4bb3b1f7eb1e

我跑了:

 npm init npm install --save express npm install --save nodemon touch app.js nano app.js #contents of app.js var express = require('express'); var app = express(); app.get('/', function(req, res){ res.send("Hello World"); }); app.listen(3000, function(){ console.log('Example app listening on port 3000!'); }); # add the following to package.json scripts section "scripts": { "start": "nodemon app.js" }, 

错误进入下面….

 npm start npm ERR! Linux 4.9.62-21.56.amzn1.x86_64 npm ERR! argv "/home/ec2-user/.nvm/versions/node/v6.11.5/bin/node" "/home/ec2-user/.nvm/versions/node/v6.11.5/bin/npm" "start" npm ERR! node v6.11.5 npm ERR! npm v3.10.10 npm ERR! missing script: start npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <https://github.com/npm/npm/issues> npm ERR! Please include the following file with any support request: npm ERR! /home/ec2-user/docker-node-mongo/npm-debug.log 

编码是有趣的,但它的工作,但男人哦,人是砖墙后的砖墙大声笑任何帮助将非常感激!