弹性beanstalk是否从package.json文件运行postinstall?

我正在使用弹性beanstalk来部署node.js应用程序。 在我的scripts部分package.json我有:

  "scripts": { "start": "node_modules/.bin/coffee server.coffee", "test": "NODE_ENV=test node test/runner.js", "coverage": "NODE_ENV=test COVERAGE=1 node test/runner.js -R html-cov test/ > ./test/coverage.html", "testw": "fswatch -o test src | xargs -n1 -I{} sh -c 'coffeelint src server.coffee ; npm test'", "db:drop": "node scripts/drop-tables.js", "encryptConfig": "node_modules/.bin/coffee config/encrypt.coffee", "decryptConfig": "node_modules/.bin/coffee config/decrypt.coffee", "postinstall": "npm run decryptConfig" }, 

npm install似乎工作。 但是postinstall不执行。 这是一个已知的问题? 如果是这样,我怎么能执行后, npm install但在npm start之前?

我刚刚也遇到了这个问题。 我发现postinstall脚本不会运行,但prestart会。 我看起来像这样:

 "scripts": { "start": "node index.js", "prestart": "node node_modules/webpack/bin/webpack.js" } 

现在,当我在本地运行eb deploy时,在启动服务器之前正确地绑定了我的webpack的东西。

我想你的意思是说你使用EB(Elastic Beanstalk)ELB作为负载平衡器。 Elastic Beanstalk默认运行npm start以运行您的应用程序。 我build议您在构build过程中将您的模块与您的应用程序打包在一起。