title: Google NPM modules fails on AWS Elastic Beanstalk
body: <p>When I tried to install google related npm modules in AWS Elastic Beanstalk, it fails and the environment gets degraded. Other packages like express or socket io works perfectly fine. Any idea on how to install google npm modules on AWS? I tried to write the module in package.json file with the version and zip it along with app.js, files not node modules</p>
  
  <pre><code>{
    "name": "dialogflow-aws",
    "version": "1.0.0",
    "description": "",
    "main": "app.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "dependencies": {
      "dialogflow": "^0.5.0",
      "express": "^4.16.3"
    }
  }
  </code></pre>
  
  <p>and click Upload &amp; Deploy on AWS ELB console. It turns red. The log as follows:- </p>
  
  <pre><code>  Running npm with --production flag
    Failed to run npm install. Snapshot logs for more details.
    Traceback (most recent call last):
      File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in &lt;module&gt;
        main()
      File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 677, in main
        node_version_manager.run_npm_install(options.app_path)
      File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 136, in run_npm_install
        self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir'))
      File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
        raise e
    subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v6.14.3-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)
  </code></pre>
  
  <p>Some more logs :</p>
  
  <pre><code>39674 silly lifecycle   'node-pre-gyp install --fallback-to-build --library=static_library' ]
  39675 verbose stack Error: spawn ENOMEM
  39675 verbose stack     at exports._errnoException (util.js:1020:11)
  39675 verbose stack     at ChildProcess.spawn (internal/child_process.js:328:11)
  39675 verbose stack     at exports.spawn (child_process.js:370:9)
  39675 verbose stack     at spawn (/opt/elasticbeanstalk/node-install/node-v6.14.3-linux-x64/lib/node_modules/npm/lib/utils/spawn.js:21:13)
  39675 verbose stack     at runCmd_ (/opt/elasticbeanstalk/node-install/node-v6.14.3-linux-x64/lib/node_modules/npm/lib/utils/lifecycle.js:247:14)
  39675 verbose stack     at /opt/elasticbeanstalk/node-install/node-v6.14.3-linux-x64/lib/node_modules/npm/lib/utils/lifecycle.js:211:7
  39675 verbose stack     at _combinedTickCallback (internal/process/next_tick.js:73:7)
  39675 verbose stack     at process._tickCallback (internal/process/next_tick.js:104:9)
  39676 verbose cwd /tmp/deployment/application
  39677 error Linux 4.14.47-56.37.amzn1.x86_64
  39678 error argv "/opt/elasticbeanstalk/node-install/node-v6.14.3-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.14.3-linux-x64/bin/npm" "--production" "install"
  39679 error node v6.14.3
  39680 error npm  v3.10.10
  39681 error code ENOMEM
  39682 error errno ENOMEM
  39683 error syscall spawn
  39684 error spawn ENOMEM
  39685 error If you need help, you may report this error at:
  39685 error     &lt;https://github.com/npm/npm/issues&gt;
  39686 verbose exit [ 1, true ]
  </code></pre>