title: AWS - EB - Node - Error: Cannot find module '../'
body: <p>Bcrypt with its dependency node-pre-gyp causes some serious issue when deployed to Elastic Beanstalk.</p>
  
  <p>bcrypt version: 3.0.6</p>
  
  <p>Nodejs version: 8.16 (also same for v.10)</p>
  
  <p>Amazon Linux 4.8.2</p>
  
  <pre><code>bcrypt@3.0.6 install /tmp/deployment/application/node_modules/bcrypt
  node-pre-gyp install --fallback-to-build
  
  module.js:550
  throw err;
  ^
  
  Error: Cannot find module '../'
  at Function.Module._resolveFilename (module.js:548:15)
  at Function.Module._load (module.js:475:25)
  at Module.require (module.js:597:17)
  at require (internal/module.js:11:18)
  at Object.&lt;anonymous&gt; (/tmp/deployment/application/node_modules/.bin/node-pre-gyp:15:20)
  at Module._compile (module.js:653:30)
  at Object.Module._extensions..js (module.js:664:10)
  at Module.load (module.js:566:32)
  at tryModuleLoad (module.js:506:12)
  at Function.Module._load (module.js:498:3)
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! bcrypt@3.0.6 install: `node-pre-gyp install --fallback-to-build`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the bcrypt@3.0.6 install script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR! /tmp/.npm/_logs/2019-08-11T14_06_34_179Z-debug.log
  Running npm install: /opt/elasticbeanstalk/node-install/node-v8.15.1-linux-x64/bin/npm
  Setting npm config jobs to 1
  npm config jobs set to 1
  Running npm with --production flag
  Failed to run npm install. Snapshot logs for more details.
  UTC 2019/08/11 14:06:34 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log 
  </code></pre>
  
  <p>And relevant sections of package.json</p>
  
  <pre><code>"dependencies": {
      "axios": "^0.19.0",
      "bcrypt": "^3.0.6",
      "body-parser": "^1.18.3",
      "chai": "^4.2.0",
      "express": "^4.16.4",
      "firebase": "^5.8.6",
      "firebase-admin": "~6.0.0",
      "jsonwebtoken": "^8.5.0",
      "mocha": "^6.0.2",
      "shortid": "^2.2.14"
    },
    "devDependencies": {
      "@babel/cli": "^7.2.3",
      "@babel/core": "^7.3.4",
      "@babel/polyfill": "^7.2.5",
      "@babel/preset-env": "^7.3.4",
      "eslint": "^4.12.0",
      "eslint-plugin-promise": "^3.6.0"
    },
    "private": true
  }
  </code></pre>