title: Elastic Beanstalk npm failing
body: <p>I am trying to upload my app to Elastic Beanstalk but the npm install is failing on node-pre-gyp install --fallback-to-build. I have tried various versions of node with no avail. It seems to be trying to get a package for linux which doesn't exist and is not needed, it is only needed for OSX (in which it is working fine).</p>
  
  <p>The solution seems to be to run npm install with the --no-optional flag but I can't find a way to make EB run install with this flag.</p>
  
  <p>Also this package seems to be a dependency for karma, which I only have as a dev dependency in my package.json file. I can see EB is installing using the --production flag so I don't know what it's trying to install it in the first place.</p>
  
  <p>Any ideas on how to work around this issue would be much appreciated.</p>
  
  <pre><code>&gt;     Running npm with --production flag
  &gt;       Failed to run npm install. Snapshot logs for more details.
  &gt;       Traceback (most recent call last):
  &gt;         File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in &lt;module&gt;
  &gt;           main()
  &gt;         File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 677, in main
  &gt;           node_version_manager.run_npm_install(options.app_path)
  &gt;         File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 136, in run_npm_install
  &gt;           self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir'))
  &gt;         File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
  &gt;           raise e
  &gt;       subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.6.1-linux-x64/bin/npm',
  &gt; '--production', 'rebuild']' returned non-zero exit status 1
  &gt; (ElasticBeanstalk::ExternalInvocationError)
  &gt;     caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
  &gt;       npm WARN package.json Room@1.0.0 No repository field.
  &gt;       npm WARN package.json Room@1.0.0 No README data
  &gt;       npm WARN package.json Room@1.0.0 No license field.
  &gt;       
  &gt;       &gt; uglifyjs-webpack-plugin@0.2.1 postinstall /tmp/deployment/application/node_modules/uglifyjs-webpack-plugin
  &gt;       &gt; node lib/post_install.js
  &gt;       
  &gt;       
  &gt;       &gt; fsevents@1.0.15 install /tmp/deployment/application/node_modules/karma/node_modules/chokidar/node_modules/fsevents
  &gt;       &gt; node-pre-gyp install --fallback-to-build
  &gt;       
  &gt;       node-pre-gyp ERR! Tried to download: https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.15/fse-v1.0.15-node-v46-linux-x64.tar.gz
  </code></pre>