2

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?

user1790300
  • 2,143
  • 10
  • 54
  • 123

2 Answers2

0

I think this might the same issue described here

So apparently npm install takes too long during automated deployments on t1.micro instances, bumping to a t2.small gives enough power to get the task done.

iurii
  • 4,142
  • 2
  • 23
  • 28
  • I already bumped it up to t2.small yesterday. The problem still persists. – user1790300 Oct 03 '18 at 15:19
  • 1
    some similar problem as well https://stackoverflow.com/questions/39602428/npm-install-on-elastic-beanstalk-fails-unless-manually-executed – iurii Oct 03 '18 at 15:22
0

There is an alternative js only module just called sass. Seems to work ok, but not as up to date as none-sass.

Gordon Truslove
  • 724
  • 2
  • 10
  • 19