0

I am trying to deploy my React SSR app, I did the following steps

eb init
eb create
eb deploy

It thorwing an error

eb deploy
Creating application version archive "app-1bc2-190303_150947".
Uploading haal/app-1bc2-190303_150947.zip to S3. This may take a while.
Upload Complete.
2019-03-03 09:39:53    INFO    Environment update is starting.      
2019-03-03 09:39:56    INFO    Deploying new version to instance(s).
2019-03-03 09:40:30    ERROR   Failed to run npm install. Snapshot logs for more details.
2019-03-03 09:40:32    ERROR   [Instance: i-02acaf076e72912d6] Command failed on instance. Return code: 1 Output: (TRUNCATED)...opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
    raise e
subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v10.15.1-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1. 
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2019-03-03 09:40:32    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2019-03-03 09:40:32    ERROR   Unsuccessful command execution on instance id(s) 'i-02acaf076e72912d6'. Aborting the operation.
2019-03-03 09:40:33    ERROR   Failed to deploy application.

I even tried to upload the build zip in the following env, still the same error. What am I doing wrong?

Subhendu Kundu
  • 3,618
  • 6
  • 26
  • 57
  • Looks like its running npm install and then failing to run that command. did you check the logs for more details? – G_S Mar 03 '19 at 10:44
  • Umm I got confused looking at the logs :D so I removed the dependencies from my package.json, cause anyway I am using my build files, which doesn't need any node_modules. Then I did a deploy which deployed without any error, however when I go to the url its throwing `502 Bad Gateway`. :( – Subhendu Kundu Mar 03 '19 at 10:55
  • Could be because of some proxy settings or so? – G_S Mar 03 '19 at 12:20
  • 1
    I am pretty new with EB :( – Subhendu Kundu Mar 03 '19 at 12:21

0 Answers0