# Specifying a Node version

**URL:** <https://answers.netlify.com/t/specifying-a-node-version/9701>\
**Category:** Features\
**Created:** [February 27, 2020, 11:47pm UTC](https://answers.netlify.com/t/specifying-a-node-version/9701 "2020-02-27T23:47:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris-activewrite](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@chris-activewrite](https://answers.netlify.com/u/chris-activewrite)\
**Post date:** [February 27, 2020, 11:47pm UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/1 "2020-02-27T23:47:34Z")

</div>

In your build instructions for Node apps ([Manage build dependencies | Netlify Docs](https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript)), the recommended way to set a Node version is via a `.node-version` file or `NODE_VERSION` env var; and similarly use `NPM_VERSION` to set the npm version, and `YARN_VERSION` to set the yarn version.

The standard way to define these (in any Node project) is via the `engines` key in `package.json` – see [https://docs.npmjs.com/files/package.json#engines](https://docs.npmjs.com/files/package.json#engines)

The approach you’re using can lead to a situation where the Node, npm and/or yarn versions used on the developer’s machine are not the same as in a Netlify build, leading to build failures or strange variation.

Don’t Repeat Yourself – this info should be in only one place. It would be better to use the package.json mechanism. If that can’t be done, it would make sense to add a prominent warning to your doc page that I referenced about to say the standard Node approach is IGNORED.

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [February 28, 2020, 1:24am UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/3 "2020-02-28T01:24:59Z")

</div>

Thanks for bringing this up, @chris-activewrite. We’ll think it over!

---

<div class="post-metadata">

**Author:** ![fool](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/fool/32/37_2.png) [@fool](https://answers.netlify.com/u/fool)\
**Post date:** [March 6, 2020, 10:06pm UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/5 "2020-03-06T22:06:02Z")

</div>

Hey Chris!

Really appreciate you taking the time to write this up so thoughtfully! We have an open feature request on this:

> <https://github.com/netlify/build-image/issues/53>
>
> Not sure if this makes sense since the field can contain a range of versions rat…her than specifying an exact version, but maybe we could limit it to supporting only a definition for node that is a single version #?
> 
> This would be in addition to setting NODE\_VERSION or .nvmrc since we obviously can't deprecate the existing methods without breaking a lot of builds.
> 
> what do you think @rybit ?
> 
> I think that there are extensive docs on the things engine could be used for - including yarn and npm version setting:
> 
> https://docs.npmjs.com/files/package.json#engines

If you could add your voice to it there, then you’ll see if we get it implemented automatically 🙂

---

<div class="post-metadata">

**Author:** ![ontoneio](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ontoneio/32/20137_2.png) [@ontoneio](https://answers.netlify.com/u/ontoneio)\
**Post date:** [December 28, 2020, 2:21am UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/7 "2020-12-28T02:21:35Z")

</div>

Is this not a thing yet??  
It would really nice since this is the standard way to set Node versions.  
I am suprised it’s not already integrated considering JAMstack and all.

Can we please get support for this??

---

<div class="post-metadata">

**Author:** ![fool](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/fool/32/37_2.png) [@fool](https://answers.netlify.com/u/fool)\
**Post date:** [January 1, 2021, 12:30am UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/8 "2021-01-01T00:30:36Z")

</div>

No status change here, @ontoneio. We’ll post in this thread if anything changes, of course!

---

<div class="post-metadata">

**Author:** ![AoDev](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/aodev/32/12358_2.png) [@AoDev](https://answers.netlify.com/u/AoDev)\
**Post date:** [January 21, 2021, 12:10am UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/9 "2021-01-21T00:10:25Z")

</div>

Some of our builds are failing. Setting the engine through the package.json would solve the problem. Please consider making this improvement.

---

<div class="post-metadata">

**Author:** ![QuantumJS](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/quantumjs/32/4466_2.png) [@QuantumJS](https://answers.netlify.com/u/QuantumJS)\
**Post date:** [April 9, 2021, 9:36am UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/10 "2021-04-09T09:36:10Z")

</div>

Wow this really threw me today. Any update?

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [April 12, 2021, 4:04am UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/11 "2021-04-12T04:04:05Z")

</div>

Hi, @QuantumJS. The feature request is linked to above. I checked the feature request but it is still “open” (meaning the feature request has not be completed yet).

If or when this feature request is added, we will post an update here.

---

<div class="post-metadata">

**Author:** ![shadowspawn](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@shadowspawn](https://answers.netlify.com/u/shadowspawn)\
**Post date:** [May 22, 2021, 6:11am UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/12 "2021-05-22T06:11:07Z")

</div>

For interest, the `.node-version` file is also used by other products. I have been collecting usage (and adding netlify).

> **[GitHub - shadowspawn/node-version-usage: Document current usage of...](https://github.com/shadowspawn/node-version-usage)**
>
> Document current usage of .node-version file. Contribute to shadowspawn/node-version-usage development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![danielo515](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/danielo515/32/22779_2.png) [@danielo515](https://answers.netlify.com/u/danielo515)\
**Post date:** [January 6, 2022, 1:44pm UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/13 "2022-01-06T13:44:38Z")

</div>

So, what is the status of this?  
The default node netlify uses it’s quite old. Kind of bad experience that your build fails because the CI uses an outdated node version.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [January 7, 2022, 4:14pm UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/14 "2022-01-07T16:14:56Z")

</div>

> [@danielo515](#):
>
> The default node netlify uses it’s quite old

We use Node 16 by default which is the latest LTS.

---

<div class="post-metadata">

**Author:** ![danielo515](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/danielo515/32/22779_2.png) [@danielo515](https://answers.netlify.com/u/danielo515)\
**Post date:** [January 9, 2022, 10:37am UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/15 "2022-01-09T10:37:57Z")

</div>

Then why is my build pipeline using node 10 if I don’t have any mechanism to set it? I had to add a npm version file to make it use 17

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [January 9, 2022, 11:40am UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/16 "2022-01-09T11:40:02Z")

</div>

What site is it? Chances are you started building on Node 10 at first and we don’t upgrade the Node Versions automatically to prevent errors due to breaking changes. All new sites use Node 16 by default, which will likely be pinned too, so they don’t break in future.

---

<div class="post-metadata">

**Author:** ![danielo515](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/danielo515/32/22779_2.png) [@danielo515](https://answers.netlify.com/u/danielo515)\
**Post date:** [January 17, 2022, 9:02am UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/17 "2022-01-17T09:02:44Z")

</div>

I created my project about 2 years ago, and yes, at that time node 10 was the default.

---

<div class="post-metadata">

**Author:** ![cavila](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/cavila/32/23695_2.png) [@cavila](https://answers.netlify.com/u/cavila)\
**Post date:** [September 23, 2022, 12:05am UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/18 "2022-09-23T00:05:43Z")

</div>

Creating a .nvmrc file fixed this issue: [How to specify a Node Version in Netlify | Reactgo](https://reactgo.com/netlify-specify-node-version/)

---

<div class="post-metadata">

**Author:** ![swrobel](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/swrobel/32/31352_2.png) [@swrobel](https://answers.netlify.com/u/swrobel)\
**Post date:** [August 10, 2023, 8:04pm UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/19 "2023-08-10T20:04:02Z")

</div>

Where is the correct place to voice our support for this now that the referenced github repo has been archived?

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [August 12, 2023, 3:29pm UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/20 "2023-08-12T15:29:37Z")

</div>

Just to confirm, @swrobel, if your concern about not being able to specify Node version, or is it about not being able to specify it in package.json? The former is already supported.

---

<div class="post-metadata">

**Author:** ![swrobel](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/swrobel/32/31352_2.png) [@swrobel](https://answers.netlify.com/u/swrobel)\
**Post date:** [August 12, 2023, 4:15pm UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/21 "2023-08-12T16:15:12Z")

</div>

it’s about not being able to specify it in the engines section of package.json

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [August 13, 2023, 3:31pm UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/22 "2023-08-13T15:31:53Z")

</div>

You can voice the concerns here, however there are no plans in the immediate future to implement this.

---

<div class="post-metadata">

**Author:** ![Anoesj](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/anoesj/32/43918_2.png) [@Anoesj](https://answers.netlify.com/u/Anoesj)\
**Post date:** [April 30, 2026, 7:14pm UTC](https://answers.netlify.com/t/specifying-a-node-version/9701/23 "2026-04-30T19:14:14Z")

</div>

It’s a shame Netlify does not support this (`engines.node`) or the more modern `devEngines.runtime` field. It’s gotten to a point where you Netlify’s build runners first need to download Node.js in order to run Corepack, then `corepack` selects the correct package manager (e.g. `pnpm`) from `packageManager` or the more modern `devEngines.packageManager`, then depending on the package manager, that may select-\>download-\>use the correct version of Node as resolved from `devEngines.runtime`.

[Next page](https://answers.netlify.com/t/specifying-a-node-version/9701.md?page=2)
