I am having some trouble to deploy my Node.JS application to AWS using ElasticBeanStalk.
As soon as the deploy starts, while running the npm install
script (default by AWS), I get the following weird error:
[email protected] node_modules/material-ui
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
npm ERR! Linux 4.1.17-22.30.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm" "--production" "install"
npm ERR! node v4.3.0
npm ERR! npm v2.14.12
npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /tmp/deployment/application/npm-debug.log
Can anyone help me debug this problem? I've already spent too many hours trying to understand what is happening, but got no results so far.
Thanks!
Updating npm
solved it for me
npm i -g npm
Apparently some AWS regions do have connection problems with npm (as related in this issue) and I solved it by forcing npm to download modules via http
instead of https
.
To do that I added a .npmrc
file to the root directory of my project with the following content: registry=http://registry.npmjs.org/
Thanks @Jason Livesay for the tips and @danilojun for helping me find the best solution!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With