Specifying a Node Version
By default, Render uses the latest LTS version of Node. You can customize this for your app in one of three ways, in order of precedence:
- Add an environment variable called
NODE_VERSION
to your app and set the value to a valid version, for example12.16.1
. -
Add a file called
.node-version
at the root of your repo. This file should contain a single line containing the full semantic Node version you’d like to use.Your
.node-version
should look like this:12.16.1
This is only used if you haven’t set
NODE_VERSION
already. -
Alternatively, you can specify a Node version in the engines directive in your
package.json
. This can be an exact version like10.17.0
or a range like>=10.11 <10.18
.This is the relevant snippet from a sample
package.json
:"engines": { "node": ">=12 <13" }
This is only used if you haven’t set
NODE_VERSION
or added a.node-version
file to the root of your repo.