Adron Adron - 2 months ago 37
Javascript Question

How does AWS Beanstalk use NPM when deploying a Nodejs App?

I'm curious about the overall workflow of an AWS Beanstalk deployment. I'm assuming it runs npm at some point to get the packages installed on the server(s). But I was just wondering if AWS Beanstalk uses the latest command of 'npm install --production' to install packages. Currently I have a packages.json file as shown below and would like to insure if possible that only the dependencies are being installed and not the devDependencies.

"dependencies": {
"express": "3.4.4",
"jade": "*",
"restify": "~2.6.0",
"assert": "~1.0.0",
"orchestrate": "0.0.2",
"chance": "~0.5.3"
},
"devDependencies": {
"mocha": "~1.15.1"
}

Answer

Currently the Elastic Beanstalk environment runs npm install without the --production flag. This happens on the instance at /opt/elasticbeanstalk/containerfiles/ebnode.py before any env customizations supplied by the developer (i.e., environment option settings) are exported, which means setting NODE_ENV=production in the EB Environment's configuration also does not prevent devDependencies from being processed.

Comments