title: Missing Modules while trying to deploy rails app on elastic beanstalk
body: <p>I am trying to install ruby on rails app via elastic beanstalk that uses node and npm. </p>
  
  <pre><code>[ec2-user@ip-172-31-41-201 client]$ node -v
  v7.8.0
  [ec2-user@ip-172-31-41-201 client]$ npm -v
  4.2.0
  </code></pre>
  
  <p>The problem is I am getting following error at the <code>"rake assets:precompile"</code> step</p>
  
  <pre><code>+ su -s /bin/bash -c 'bundle exec rake assets:precompile' webapp
    cd client &amp;&amp; npm run build:client
  
    &gt; @ build:client /var/app/ondeck/client
    &gt; npm run ensure-node-version &amp;&amp; webpack --config webpack.client.config.js
  
  
    &gt; @ ensure-node-version /var/app/ondeck/client
    &gt; check-node-version --package
  
    sh: check-node-version: command not found
  
    npm ERR! Linux 4.14.88-72.76.amzn1.x86_64
    npm ERR! argv "/opt/elasticbeanstalk/support/node-install/node-v7.8.0-linux-x64/bin/node" "/usr/bin/npm" "run" "ensure-node-version"
    npm ERR! node v7.8.0
    npm ERR! npm  v4.2.0
    npm ERR! file sh
    npm ERR! code ELIFECYCLE
    npm ERR! errno ENOENT
    npm ERR! syscall spawn
    npm ERR! @ ensure-node-version: `check-node-version --package`
    npm ERR! spawn ENOENT
    npm ERR!
    npm ERR! Failed at the @ ensure-node-version script 'check-node-version --package'.
    npm ERR! Make sure you have the latest version of node.js and npm installed.
    npm ERR! If you do, this is most likely a problem with the  package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     check-node-version --package
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR!     npm bugs
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR!     npm owner ls
    npm ERR! There is likely additional logging output above.
    npm WARN Local package.json exists, but node_modules missing, did you mean to install?
  
    npm ERR! Please include the following file with any support request:
    npm ERR!     /home/webapp/.npm/_logs/2019-01-26T17_19_36_394Z-debug.log
  </code></pre>
  
  <p>But i can see chceck-node-version is installed</p>
  
  <pre><code>[ec2-user@ip-172-31-41-201 client]$ npm view check-node-version version
  3.2.0
  </code></pre>
  
  <p>Interestingly i get missing script check-node-version when i run following command</p>
  
  <pre><code>[ec2-user@ip-172-31-41-201 client]$ npm run check-node-version
  npm ERR! Linux 4.14.88-72.76.amzn1.x86_64
  npm ERR! argv "/opt/elasticbeanstalk/support/node-install/node-v7.8.0-linux-x64/bin/node" "/usr/bin/npm" "run" "check-node-version"
  npm ERR! node v7.8.0
  npm ERR! npm  v4.2.0
  
  npm ERR! missing script: check-node-version
  npm ERR!
  npm ERR! If you need help, you may report this error at:
  npm ERR!     &lt;https://github.com/npm/npm/issues&gt;
  
  npm ERR! Please include the following file with any support request:
  npm ERR!     /home/ec2-user/.npm/_logs/2019-01-26T17_38_37_148Z-debug.log
  </code></pre>
  
  <p>Any suggestions as to what I am doing wrong? </p>