I've got a PHP application that uses gulp to build the production files, I'm using elasticbeanstalk to deploy my app to and AWS EC2 instance and I want to install node and npm to run gulp during the deploy, my current configuration is:
01-installPackages.config inside .ebextenstions folder
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'
the node commands fails but if I ssh in and i run that command node is installed
any idea of what's wrong with my configuration?
Thanks!
The current answer for this is the following:
commands:
01enable_epel:
command: sudo amazon-linux-extras install epel
02npm_install:
command: sudo yum -y --enablerepo=epel install nodejs npm
using the extras library documented in AWS docs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With