AWS Elastic Beanstalk Node.js npm installation error

During application deployment, npm install cannot install a very specific dependency:

npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/deployment/application/node_modules/babel-core/node_modules/regexpu/node_modules/regjsparser/node_modules/jsesc/bin/jsesc'

I was able to find this error above using ssh'ing in a specific instance of EC2 that hosts my Node application and runs npm install with the following command:

sudo /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install 2

What follows is this common failure:

Failed to run npm install. Snapshot logs for more details. No environment variable EB_EVENT_FILE found. Writing message to stderr. Msg: Failed to run npm install. Snapshot logs for more details.

What is strange is that I was able to deploy it successfully earlier, and use the same exact configurations for the previous deployment. My only command is to run npm inside .ebextensions /.

In my .json package, I changed all dev dependencies to dependencies, since webpack builds during preart.

All this builds and works locally, by the way. I also use Node 4.2.1 and npm 2.14.7 on EB.

Any help would be awesome. Thanks!

+4
1

Docker, . , EB, - .

+1

Source: https://habr.com/ru/post/1618864/


All Articles