10

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

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

However in Elastic Beanstalk, when new instances are created they appear with node version of 0.10.0. How can we update the version in Elastic Beanstalk so the new instances created have the required version placed in package.json?

Thank you very much.

3
  • Using Elastic Beanstalk you can upgrade till node 2.1.3 Commented Aug 16, 2016 at 17:34
  • Where is the setting to change that? Commented Aug 16, 2016 at 19:40
  • Check this imgur.com/a/c3Wsa Commented Aug 16, 2016 at 19:41

1 Answer 1

11

Verifying the version is supported

Most newer Beanstalk platforms have up to 6.2.2 for Node.js so if your platform version is up to date you should have it (current platform version for Node.js is v2.1.3).

If you do not want to update your current platform you can verify 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"
}

Making it work

In order for your application to start up with correct Node version you will have to set the option setting for the specific version. This can be done multiple ways.

Web UI

Navigate to the Configuration tab for your environment and then into the Software Configuration panel to change the Node version setting. Click apply when you are finished to deploy the changes to your environment.

AWS CLI

You can update your environment with the correct option setting via the command line interface.

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

Here are some additional option settings specific to the Node.js platform.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.