You can specify a Node.js version for site in Gatsby Cloud in two different ways, by environment variable or .nvmrc file. If you don't set a Node version, Gatsby cloud will use the following defaults:
- The default Node.js version is
v14
. - If you are using NPM 7, the default is
v16
Environment Variable
You can set your Node.js version using the NODE_VERSION
environment variable inside Gatsby Cloud. Read more about setting environment variables here.
Using nvm
You can include a .nvmrc
file in your project repository, and Gatsby Cloud will read the node version from that file.
Example format:
v14.19.0
NOTE: NODE_VERSION environment variable takes precedence over .nvmrc file.
Comments
0 comments
Please sign in to leave a comment.