Node.js configuration
Choose the Node.js version a site builds with, add global packages and follow the version your repository asks for.
Before you start
- You can open the site in Managed Websites. Anyone who can open a site can change its Node.js configuration.
- Each environment has its own version and packages: choose Production or Staging in the site header first.
Change the version
Open the version list
Go to Managed Websites, choose the site, then Software & services under Site settings. Choose Change… beside Node.js.
Choose the version
Choose a version under Recommended or Supported. The dialog lists what else changes, then the button names your choice, such as Change to Node.js 26.
Review and apply
Choose Review and apply, then Apply.
Your first change on an environment also turns on instant changes, now or in tonight's maintenance window as the card says.
After that, a change applies straight away. Commands that are running keep their version; new ones use the version you chose.
An end-of-life version asks you to tick a box saying it gets no security fixes.
Add a global package
Open Node.js configuration
Choose Configure… beside Node.js, then Add package.
Choose the package
Choose one of the Common tools or enter a package name from npm. Leave Version empty for the newest, or enter the one you need, then choose Add.
Review and apply
Choose Review and apply, then Apply.
An environment keeps up to 20 global packages, from the public npm registry only. yarn and pnpm are built in through Corepack.
Settings
| Setting | What it does |
|---|---|
| Follow the repository | Before each deployment, switches to the version your repository asks for in .nvmrc, .node-version, engines or volta, if it is offered and supported. Never to an end-of-life version. |
| Caches | Clear… empties the npm, Corepack, pnpm and yarn caches. Your packages and projects are not touched. |
With Follow the repository off, a deployment only warns when the repository asks for another version.
Automate this
Changes the Node.js version, the global packages or follow mode: send the revision of your last read and what you change.
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/node-runtime \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"follow_repository": true,
"revision": 4
}'Your assistant calls corestack_node_version_change.
{
"name": "corestack_node_version_change",
"arguments": {
"site_id": 4211,
"revision": 7,
"major": 24
}
}