I am trying to deploy a reactjs app to an elastic beanstalk instance and seem to be encountering several issues.
1) I am receiving this error in the health section for elastic beanstalk:
- /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
node-sass@4.9.3 install /tmp/deployment/application/node_modules/node-sass node scripts/install.js
Unable to save binary /tmp/deployment/application/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/tmp/deployment/application/node_modules/node-sass/vendor' at Object.fs.mkdirSync (fs.js:885:18) at sync (/tmp/deployment/application/node_modules/mkdirp/index.js:71:13) at Function.sync (/tmp/deployment/application/node_modules/mkdirp/index.js:77:24) at checkAndDownloadBinary (/tmp/deployment/application/node_modules/node-sass/scripts/install.js:114:11) at Object. (/tmp/deployment/application/node_modules/node-sass/scripts/install.js:157:1) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) errno: -13, code: 'EACCES', syscall: 'mkdir', path: '/tmp/deployment/application/node_modules/node-sass/vendor' }
2) At the same time it appears as if node and npm are claiming all of the resources for my ec2 instance and this seems to continue even after the deployment fails.
What could be the cause of this failure? The other packages seems to be deploying as they are in the node_modules folder? Additionally, why would node take up resources in this fashion?
The reactjs app is using webpack and node-sass ^4.9.3 and node version 8.11.3 which works on my local environment.
Update: .npmrc solved the permission issue. I am still having a problem with the cpu being 100%. In the build script, the code is not getting past this line, I adding console.log lines at various points in the code:
let compiler = webpack(config);
After this line is hit, I am not seeing any advancement. Could this be a webpack issue?