Reputation: 876
I I have a NodeJS environment running a very simple, and low-resource intensive app, that out of nowhere started giving me "failure to run npm install" problems.
It all started when I made a deploy, and the deployed bundle was exactly the same as the last previous successful deploy - identical in every way. But somehow, it failed to build the app. I tried rolling back, didn't work.
If I do a "environment rebuild" it magically works, then if I do ANYTHING to the environment, like changing the smallest config setting or doing a deploy (again, of a bundle exactly the same as the one running) it gives me this error.
And the worse part is: it gives me no detail at all about the problem. It just hangs forever in the command execution and then gives me the error message below. I even tried running the command manually, and the results are the same. I have no idea what is going on, and this is a PRODUCTION environment.
[2017-10-31T10:52:04.566Z] INFO [20105] - [Application update 1.3.0.797-sched@71/AppDeployStage0/AppDeployPreHook/50npm.sh] : Starting activity...
[2017-10-31T10:57:21.426Z] INFO [20105] - [Application update 1.3.0.797-sched@71/AppDeployStage0/AppDeployPreHook/50npm.sh] : Activity execution failed, because: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
npm WARN deprecated [email protected]: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
Running npm install: /opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm
Setting npm config jobs to 1
npm config jobs set to 1
Running npm with --production flag
Failed to run npm install. Snapshot logs for more details.
UTC 2017/10/31 10:57:20 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
Traceback (most recent call last):
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in <module>
main()
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 677, in main
node_version_manager.run_npm_install(options.app_path)
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 136, in run_npm_install
self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir'))
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
Upvotes: 2
Views: 2411
Reputation: 10194
There seems to be problems related to nano server not powerful enough to handle npm install.
ref : https://forums.aws.amazon.com/message.jspa?messageID=725728
You could deploy a prepackaged version of you app or increase the instance sizing.
There is also a workaround in the thread above allocating swap.
Upvotes: 1