title: AWS Elasticbeanstalk install node and npm in PHP instance type
body: <p>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:</p>
  
  <p>01-installPackages.config inside .ebextenstions folder</p>
  
  <pre><code>commands:
    01updateComposer:
      command: export COMPOSER_HOME=/root &amp;&amp; /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 ] &amp;&amp; echo "node not installed"'
        # install from epel repository
        # flag -y for no-interaction installation
        command: 'sudo yum install -y nodejs --enablerepo=epel'
  </code></pre>
  
  <p>the node commands fails but if I ssh in and i run that command node is installed</p>
  
  <p>any idea of what's wrong with my configuration?</p>
  
  <p>Thanks!</p>