0

I am trying to deploy a simple NodeJS Express application to Elastic Beanstalk using the EB CLI. However, my deployment always fails. When checking the logs, I find the following error:

2020/05/24 22:40:30.221497 [INFO] Running command /bin/sh -c npm --production rebuild
2020/05/24 22:40:30.900907 [INFO] 
> bcrypt@4.0.1 install /var/app/staging/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

2020/05/24 22:40:30.900921 [ERROR] sh: /var/app/staging/node_modules/.bin/node-pre-gyp: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! bcrypt@4.0.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the bcrypt@4.0.1 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!     /root/.npm/_logs/2020-05-24T22_40_30_889Z-debug.log

2020/05/24 22:40:30.900934 [ERROR] An error occurred during execution of command [app-deploy] - [Use NPM to install dependencies]. Stop running the command. Error: Command /bin/sh -c npm --production rebuild failed with error exit status 126. Stderr:sh: /var/app/staging/node_modules/.bin/node-pre-gyp: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! bcrypt@4.0.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the bcrypt@4.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

bycrypt is a Node library that I am using but I am not sure why there is a permission denied error showing up. This solution here Beanstalk: Node.js deployment - node-gyp fails due to permission denied did not work for me.

0 Answers0