I am stuck in a very weird issue from the last two days. I am trying to deploy my webpack nodejs app on AWS elastic beanstalk. The Environment Health changes from OK to Degraded. I have deployed it many times before but no such issue occurred. First of all, see the logs:
/var/log/eb-activity.log
/opt/elasticbeanstalk/containerfiles/ebnode.py --action node-install Activity execution failed, because: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
npm ERR! path /tmp/deployment/application/node_modules/grpc/node_modules/.bin/node-pre-gyp npm ERR! code EEXIST npm ERR! Refusing to delete /tmp/deployment/application/node_modules/grpc/node_modules/.bin/node-pre-gyp: is outside /tmp/deployment/application/node_modules/grpc/node_modules/node-pre-gyp and not a link
npm ERR! File exists: /tmp/deployment/application/node_modules/grpc/node_modules/.bin/node-pre-gyp npm ERR! Move it away, and try again. npm ERR! A complete log of this run can be found in: npm ERR! /tmp/.npm/_logs/2018-09-18T05_49_17_967Z-debug.log Running npm install: /opt/elasticbeanstalk/node-install/node-v8.9.3-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 2018/09/18 05:49:17 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 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 raise e subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v8.9.3-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
Now the error is of some node-gyp module and trust me I haven't heard it before. I am trying for a solution so that I can continue my work because this is really an embarrassing situation for me in front of my boss. Your help can get me out of this situation.
Thanks