Specify Node.js Version

Specify a Node.js version for your JavaScript storefront applications globally or for a specific application.

Context

A new flag is added to the manifest.json file. You can now specify a Node.js version for your applications. If you don't specify it yourself, the flag with the most recent supported version is added by default. When adding a Node.js version to your manifest you should only specify the major version number, for example: "nodeVersion": "20" instead of "nodeVersion": "20.9.0".

Procedure

  • Add the following line to the js-storefront/manifest.json file to specify a Node.js version for all your static applications:
    {
        "applications": [
            {
                "name": "cxlive",
                "path": "cxlive"
            },
            {
                "name": "app1",
                "path": "app1"
            },
            {
                "name": "app2",
                "path": "app2"
            }
        ],
        "nodeVersion": "20"
    }
  • Add the following line to the js-storefront/manifest.json file to specify a Node.js version for a specific static application:
    {
        "applications": [
            {
                "name": "cxlive",
                "path": "cxlive"
            },
            {
                "name": "app1",
                "path": "app1"
            },
            {
                "name": "app2",
                "path": "app2",
                "nodeVersion": "20"
            }
        ],
    }
  • Add the following lines to the js-storefront/manifest.json file to specify a Node.js version globally and a different one for a specific static application:
    {
        "applications": [
            {
                "name": "cxlive",
                "path": "cxlive"
            },
            {
                "name": "app1",
                "path": "app1"
            },
            {
                "name": "app2",
                "path": "app2",
                "nodeVersion": "18"
            }
        ],
        "nodeVersion": "20"
    }