Skip to content

Instantly share code, notes, and snippets.

@BillClinton
Last active October 13, 2019 02:14
Show Gist options
  • Save BillClinton/c59f6c9a4f9c74b3d60151d083ae5f31 to your computer and use it in GitHub Desktop.
Save BillClinton/c59f6c9a4f9c74b3d60151d083ae5f31 to your computer and use it in GitHub Desktop.
elastic-beanstalk-node

502 Bad Gateway errors

nginx is connecting to node on 8081, so make sure port defaults to 8081

app.set('port', process.env.PORT || 8081);

Make sure run command is specified

  • From the EB App Dashboard, go to Eb Configuration -> Software Configuration.
  • Under Container Options -> Node Command add "npm start", or "node ".

Beanstalk: Node.js deployment - node-gyp fails due to permission denied

  • The solution is to add the file .npmrc to the application with the content:
# Force npm to run node-gyp also as root, preventing permission denied errors in AWS with npm@5
unsafe-perm=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment