我有一个使用 gulp 构建生产文件的 PHP 应用程序,我正在使用 elasticbeanstalk 将我的应用程序部署到 AWS EC2 实例,我想安装 Node 和 npm 以在部署期间运行 gulp,我当前的配置是:
01-installPackages.config inside .ebextenstions 文件夹
commands:
01updateComposer:
command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update
02installNode:
command:
# 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: 'sudo yum install -y nodejs --enablerepo=epel'
Node 命令失败但如果我 ssh 进入并运行该命令 Node 已安装
知道我的配置有什么问题吗?
谢谢!
最佳答案
当前的答案如下:
commands:
01enable_epel:
command: sudo amazon-linux-extras install epel
02npm_install:
command: sudo yum -y --enablerepo=epel install nodejs npm
使用 extras 库记录 in AWS docs
关于node.js - AWS Elasticbeanstalk 在 PHP 实例类型中安装 Node 和 npm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32765875/