Upgrade Nodejs version in elastic beanstalk

We have some problems with the node version in production, so we changed the version required in package.json from 0.10.0 to 6.2.2. .

  "engines": { "node": ">= 6.2.2" } 

However, in Elastic Beanstalk, when creating new instances, they are displayed with node version 0.10.0 . How can we upgrade the version in Elastic Beanstalk so that the newly created instances have the required version hosted in package.json ?

Many thanks.

+6
source share
1 answer

Version Verification Supported

Most new Beanstalk platforms have up to 6.2.2 for Node.js, so if your version of the platform is updated, you must have it (the current version of the platform for Node.js is v2.1.3).

If you do not want to update the current platform, you can check which versions are valid using the AWS CLI:

 aws elasticbeanstalk describe-configuration-options --solution-stack-name "64bit Amazon Linux 2016.03 v2.1.3 running Node.js" --options "OptionName=NodeVersion, Namespace=aws:elasticbeanstalk:container:nodejs" 

Which should return something like:

 { "Options": [ { "Name": "NodeVersion", "UserDefined": false, "DefaultValue": "4.4.6", "ChangeSeverity": "RestartApplicationServer", "Namespace": "aws:elasticbeanstalk:container:nodejs", "ValueType": "Scalar", "ValueOptions": [ "0.8.28", "0.10.46", "0.12.15", "4.4.6", "5.12.0", "6.2.2" ] } ], "SolutionStackName": "64bit Amazon Linux 2016.03 v2.1.3 running Node.js" } 

Job assignment

In order for your application to start with the correct version of Node, you will need to set a parameter for a specific version. There are several ways to do this.

Web interface

Click the Configuration tab for your environment, and then go to the Software Configuration panel to change the configuration of the Node version . Click Apply when you are finished deploying the changes to your environment.

AWS CLI

You can update the environment by setting the parameter correctly through the command line interface.

 aws elasticbeanstalk update-environment --environment-name yourEnvName --option-settings "OptionName=NodeVersion, Namespace=aws:elasticbeanstalk:container:nodejs, Value=6.2.2" 

Below are some additional options related to the Node.js platform .

+5
source

All Articles