title: Run npm build script in bash script file
body: <p>I have deployed a gatsby.js website in AWS s3 server and I wanted to add a crontab for running <code>npm run build</code> at certain intervals. The crontab is working fine (I have tested it with several other commands) however it seems to fail on the npm script run</p>
  
  <p>The contents of the <code>build-script.sh</code> are:</p>
  
  <pre><code>#!/bin/bash
  #!/usr/local/bin/npm
  cd /var/www/my-website
  npm run-script build
  </code></pre>
  
  <p>Both <code>npm run-script build</code> and <code>npm run build</code> failed. Is there any particular reason for this?</p>
  
  <p>Edit: after suggestion I tried adding the full path to npm (didn't work)
  Also, running the command manually from the bash <code>bash build-script.sh</code> works and outputs the expected result.</p>
  
  <p>Update: after logging the failing command (<code>npm run build</code>) I get <code>usr/bin/env: 'node': No such file or directory</code></p>