Does elastic beanstalk run the postinstall from a package.json file?

I've just come across this problem too. I found that a postinstall script would not run but a prestart would. Mine looks like this:

"scripts": {
    "start": "node index.js",
    "prestart": "node node_modules/webpack/bin/webpack.js"
}

That now correctly bundles my webpack stuff before starting the server when I run eb deploy locally.


I think you meant that you are using EB (Elastic Beanstalk) ELB being the load balancer. Elastic Beanstalk is running npm start by default to run your application. I recommend you to package your modules with your application in your build process.