I have a node application deployed to aws elastic beanstalk, using the latest platform (Nodejs running on 64bit Amazon Linux/4.9.2) and the latest available node version (10.16.0)
In the package.json file, as long as I am installing bcrypt ^2.0.1, everything works great.
However, if I try to update to the latest version of bcrypt ^3.0.6, elastic beanstalk fails during deploy with the following error:
Error: Cannot find module '../'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/tmp/deployment/application/node_modules/.bin/node-pre-gyp:15:20)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585: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.
On bcrypt's site there is mention of a permissions issue with aws and bcrypt, and a suggested fix. However, the fix did not work for me. This seems to be a different problem.
Has anyone else encountered this before?