使用php Elastic Beanstalk环境中的节点JS
我正在尝试使用shell_exec运行这样的节点应用程序:使用php Elastic Beanstalk环境中的节点JS,php,amazon-web-services,amazon-ec2,amazon-elastic-beanstalk,Php,Amazon Web Services,Amazon Ec2,Amazon Elastic Beanstalk,我正在尝试使用shell_exec运行这样的节点应用程序: shell_exec(node app.js) ; commands: 01_node_install: # run this command from /tmp directory cwd: /tmp # don't run the command if node is already installed (file /usr/bin/node exists) test: '[ ! -f /usr
shell_exec(node app.js) ;
commands:
01_node_install:
# run this command from /tmp directory
cwd: /tmp
# don't run the command if node is already installed (file /usr/bin/node exists)
test: '[ ! -f /usr/bin/node ] && echo "node not installed"'
# install from epel repository
# flag -y for no-interaction installation
command: 'yum install -y nodejs --enablerepo=epel'
但我有一个错误:
sh:node:未找到命令
我曾尝试使用confing文件安装node js,如下所示:
shell_exec(node app.js) ;
commands:
01_node_install:
# run this command from /tmp directory
cwd: /tmp
# don't run the command if node is already installed (file /usr/bin/node exists)
test: '[ ! -f /usr/bin/node ] && echo "node not installed"'
# install from epel repository
# flag -y for no-interaction installation
command: 'yum install -y nodejs --enablerepo=epel'
这是我所有的env.config文件,但我在Elastic Beanstalk日志中没有看到与此相关的任何内容,问题仍然存在。
如何使用php环境中的NodeJS 您的配置文件正常。只需确保env.config位于项目根目录中的.ebextensions文件夹中