Node.js 如何通过EB'调用多个命令;什么是NodeCommand? 上下文

Node.js 如何通过EB'调用多个命令;什么是NodeCommand? 上下文,node.js,amazon-web-services,amazon-elastic-beanstalk,lerna,Node.js,Amazon Web Services,Amazon Elastic Beanstalk,Lerna,给定AWS的Elastic Beanstalk(like)上的一个简单节点应用程序和默认的nodecommand.config文件,如下所示: option_settings: aws:elasticbeanstalk:container:nodejs: NodeCommand: npm start 问题: 如何调用多个bash命令来代替npm start?我希望能够做到以下几点: NodeCommand: echo 'Hello' && npm start

给定AWS的Elastic Beanstalk(like)上的一个简单节点应用程序和默认的
nodecommand.config
文件,如下所示:

option_settings:
  aws:elasticbeanstalk:container:nodejs:
    NodeCommand: npm start
问题: 如何调用多个bash命令来代替
npm start
?我希望能够做到以下几点:

    NodeCommand: echo 'Hello' && npm start
或:

但似乎第一个单词之后的所有内容实际上都作为单个参数传入,从而在
/var/log/nodejs/nodejs.log
中产生以下输出:

'Hello' && npm start
'Hello' && npm start
'Hello' && npm start
...

# Logged repeatedly as the server tries and fails to start,
# apparently invoking `echo "'Hello' && npm start"` each time...
有没有办法绕过这个愚蠢的限制,直接运行多个bash命令

动机
我有一个Lerna应用程序,它在根目录中没有任何有用的
start
脚本,而是在
packages/api/
中有一个
start
脚本。我在这里特别需要的是能够在运行
start
之前更改目录,但是我正在寻找一个通用的解决方案来解决运行多个命令的问题。

我的解决方法是向
包.json添加一个脚本:

"scripts": {
  "start": "node app.js",
  "start:eb": "echo 'Hello' && npm start"
}
用法:

option_settings:
  aws:elasticbeanstalk:container:nodejs:
    NodeCommand: npm run start:eb

如果它与其他人相关,我之所以来到这里是因为nginx出现了一个不明确的
502坏网关
错误,因为服务器没有启动,但是
/var/log/nodejs/nodejs.log中绝对没有任何内容。我终于意识到这是因为NodeCommand被AWS弄坏了

option_settings:
  aws:elasticbeanstalk:container:nodejs:
    NodeCommand: npm run start:eb