Reputation: 17246
I'm trying to debug an issue with a Node application running on Elastic Beanstalk. The issue appears only under EB, and I can't reproduce on a dev machine, even when running with production configuration locally.
Unlike other EB platforms, the Node platform really seems to go out of its way to hide the Node bin/ path so you can't run npm or node commands from a shell. I realize that you don't normally want to operate this way under EB, but I also need a shorter debugging feedback loop than waiting 5 minutes for an EB deploy to test every little tweak.
Piecing together information from here and here I understand where the pieces are, but what is the most straightforward way to run a simple npm run script
command?
Upvotes: 5
Views: 1861
Reputation: 1602
Once logged in:
Choose your node version:
export PATH=$PATH:/opt/elasticbeanstalk/node-install/node-v8.11.1-linux-x64/bin/
Run your command:
cd /var/app/current/
npm ls
Upvotes: 6
Reputation: 49
To debug an issue on your elastic beanstalk instance you just need to SSH to your machine (you can find details in EC2>Instances section in WEB AWS console: https://console.aws.amazon.com/ec2 ). Then debug your code on that machine.
If you can't ssh to elastic beanstalk instance and you still need to run some script after deployment you can do it by placing .ebextensions
a folder in your app root folder and create script that will be fireup on some specific event. More information you can find here: https://stackoverflow.com/a/26804625/6541812
Upvotes: -2