I run eb init
and deploy, I get the node.js version 6, how can I specify that I want node.js version 8 when executing eb init
command?
This is an interesting question and I would love to know if there's an easier way, but here's how I got it working:
Determine the latest SolutionStack
name as listed here. Presently, this is "64bit Amazon Linux 2017.09 v4.4.4 running Node.js".
Perform eb init -p "64bit Amazon Linux 2017.09 v4.4.4 running Node.js"
.ebextensions
directory..ebextensions/nodejs_version.config
add the following snippet to it:
option_settings:
aws:elasticbeanstalk:container:nodejs:
NodeVersion: 8.9.3
eb create
Once the environment has begun building, you can execute:
aws elasticbeanstalk describe-configuration-settings \
--environment-name <environment-name> \
--application-name <application-name>
Look for option settings in the aws:elasticbeanstalk:container:nodejs
namespace and you should see the NodeVersion
assigned to 8.9.3.
Ideally, "64bit Amazon Linux 2017.09 v4.4.4 running Node.js" itself should identify the latest version; you shouldn't need to add an option setting for this, unfortunately that is not so.