我将MEAN.js Node应用程序部署到AWS。步骤1-4是我从本地计算机运行的命令:
1)grunt build
(完成)
2)git commit -m "production deployment"
我新连接的生产文件。 (DONE)
3)在AWS上设置NODE_ENV=production
。 (DONE)
3)设置AWS" NodeCommand"到grunt
。 (DONE)
4)git aws.push
(完成)
此时我的部署失败了,因为应用程序已上传到我的EC2然后grunt
被调用,但由于grunt没有全局安装,因此应用程序无法启动。
我已尝试将设置步骤3设为node_modules/grunt-cli/bin/grunt
这是我的package.json(应用程序启动时应该安装bower依赖项。我认为)。
},
{
"name": "blah",
"description": "blah",
"version": "0.0.1",
"author": "me",
"engines": {
"node": "0.10.x",
"npm": "1.4.x"
},
"scripts": { <--------------------------------------------------- These scripts run?
"start": "node_modules/grunt-cli/bin/grunt",
"test": "node_modules/grunt-cli/bin/grunt test",
"postinstall": "node_modules/bower/bin/bower install --config.interactive=false"
},
"dependencies": {
"express": "~4.9.5",
"express-session": "~1.8.2",
"body-parser": "~1.9.0",
"cookie-parser": "~1.3.2",
"compression": "~1.1.0",
"method-override": "~2.2.0",
"morgan": "~1.3.2",
"connect-mongo": "~0.4.1",
"connect-flash": "~0.1.1",
"helmet": "~0.4.0",
"consolidate": "~0.10.0",
"swig": "~1.4.1",
"mongoose": "~3.8.8",
"passport": "~0.2.0",
"passport-local": "~1.0.0",
"passport-facebook": "~1.0.2",
"passport-twitter": "~1.0.2",
"passport-linkedin": "~0.1.3",
"passport-google-oauth": "~0.1.5",
"passport-github": "~0.1.5",
"lodash": "~2.4.1",
"forever": "~0.11.0",
"bower": "~1.3.8",
"grunt-cli": "~0.1.13",
"glob": "~4.0.5",
"async": "~0.9.0",
"nodemailer": "~1.3.0",
"nodemailer-ses-transport": "~1.2.0",
"nodemailer-dkim": "~1.0.1"
},
"devDependencies": {
"supertest": "~0.14.0",
"should": "~4.0.4",
"grunt-env": "~0.4.1",
"grunt-node-inspector": "~0.1.3",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-csslint": "^0.3.1",
"grunt-ng-annotate": "~0.4.0",
"grunt-contrib-uglify": "~0.6.0",
"grunt-contrib-cssmin": "~0.10.0",
"grunt-nodemon": "~0.3.0",
"grunt-concurrent": "~1.0.0",
"grunt-mocha-test": "~0.12.1",
"grunt-karma": "~0.9.0",
"load-grunt-tasks": "~0.6.0",
"karma": "~0.12.0",
"karma-jasmine": "~0.2.1",
"karma-coverage": "~0.2.0",
"karma-chrome-launcher": "~0.1.2",
"karma-firefox-launcher": "~0.1.3",
"karma-phantomjs-launcher": "~0.1.2"
}
}