AWS Elastic Beanstalk:我是否必须使用完整的“/ node_modules”和“/ bower_components”来部署我的应用程序,并编译sass和其他依赖项?
我不明白AWS Elastic Beanstalk在Node.js应用程序中的工作方式。 Node.js开发的最佳实践是,不必将/node_modules
或/bower_components
或其他第三方包推送到版本控制系统(例如GitHub),而只需将package.json
。 所有这些/node_modules
必须在.gitignore
。 然后任何人都可以执行npm install
或bower install
并安装所有依赖项。 sass
也是一样 – 编译生产环境。
好的,但AWS Elastic Beanstalk呢? 我如何创build我的Node.js应用程序的源代码包? 我必须提交FULL /node_modules
和/bower_components
,然后用它们做一个.zip
包吗? 但是我的HEAD提交没有/node_modules
,因为/node_modules
在.gitignore
。 所以在.zip
bundle中不会有依赖:
git archive --format=zip HEAD > app.zip
或者,在我将app.zip
部署到AWS Elastic Beanstalk之后,是否可以select安装所有依赖项?
或者AWS Elastic Beanstalk在我上传了我的app.zip
包之后立刻自行npm install
在某个地方?
Elastic Beanstalk在使用goto部署应用程序时运行几个npm命令。 几个月前我做了一个小实验 。
总之,你可以使用npm install
来部署你的依赖关系,然后使用npm prestart
来构build和编译像sass这样的东西。
- AWS弹性beanstalk部署因ENOMEM错误而失败
- 密码保护AWS Node EB应用程序
- ElasticBeanstalk nodejs.log找不到模块“hogan.js”
- 如何在Elastic Beanstalk上使用私有的npmregistry?
- Node&Elastic Beanstalk:设置环境NODE_ENV = prod
- Amazon Elatisc BeanStalk单实例上的SSL端口NodeJS
- parsing服务器云代码afterSave不工作在Elastic Beanstalk上
- 如何为Node.js WebSocket服务器configurationAWS Elastic Beanstalk?
- AWS – 通过npm install来安装bower组件