View categories

Categories

Heroku Node.js Support Reference

Last updated December 03, 2025

Heroku supports Node.js applications, including ones built with popular frameworks. This document contains version support info.

For a more detailed explanation of how to deploy an application, seeGetting Started on Heroku with Node.js orGetting Started on Heroku Fir with Node.js. For general behavior info of Heroku recognizes and executes Node.js applications, seeNode.js Behavior in Heroku.

Node.js Runtime

Supported Node.js Versions

For apps usingclassic buildpacks orCloud Native Buildpacks, ourNode.js version support follows theNode.js support policy. This support includes the following versions according to theNode.js release schedule:

ReleaseStatusEnd-of-life
25.xCurrent2026-06-01
24.xActive LTS2028-04-30
22.xMaintenance LTS2027-04-30
20.xMaintenance LTS2026-04-30

While older versions ofNode.js are always available to install on the platform, only use them to incrementally upgrade an application to a supported version.

We recommend:

  • Using onlyActive LTS orMaintenance LTS releases in production
  • Always running the latest patch release of supportedNode.js versions
  • Upgrading before aNode.js release is End-of-life (EOL)

Specifying a Node.js Version

Always specify aNode.js version that matches the runtime that you’re developing and testing with. To find your version locally runnode --version.

To specify the version ofNode.js to use on Heroku, use theengines section ofpackage.json.

{  "name": "example-app",  "engines": {    "node": "24.x"  }}

If a Node version isn’t specified in theengines section,Node.js24.x is used automatically.You can also specify a minor range such as24.11 or an exact version, like24.11.0.

Because Node does regular security releases on all supported major versions, we recommend specifying a majorrange to get security updates automatically, for example,24.x.

 

We don’t recommend the use of wide ranges like>= 24.x as these ranges have no upper limit and could install a higher versionof Node.js than intended as new versions become available.

Specifying a Package Manager

You can build Node.js applications usingnpm,pnpm, andYarn. Directions for how to configure each package manager is found below.

You can only use one package manager with your application.

Using npm

If you have apackage-lock.json file at the root of your application along withpackage.json, Heroku downloads and installsnpm, which is used to install dependencies and build your application.

Node.js comes bundled withnpm, so most of the timespecifying an npm version isn’t necessary but is recommended. If you intentionally use a different version ofnpm locally, specify the same version on Heroku.

npm Version Policy

The release-line version ofnpm bundled with thesupported Node.js versions can be usedfor building Heroku applications. Older versions ofnpm may continue to work but this is not guaranteed. Using thelatest version ofnpm isrecommended.

ReleaseBundled npm Version
24.x11.x
22.x10.x
20.x10.x

Specifying an npm Version

To specify thenpm version for your application builds, use theengines.npm field inpackage.json:

{  "name": "example-app",  "engines": {    "npm": "10.x"  }}

Using pnpm

If you have apnpm-lock.yaml file at the root of your application along withpackage.json, Heroku downloads andinstallspnpm which will be used to install dependencies and build your application. The version ofpnpmmust alsobe specified.

pnpm Version Policy

Anypnpm version that runs on thesupported Node.js versions can be used for buildingHeroku applications. Older versions ofpnpm may continue to work but this is not guaranteed. Using thelatest version ofpnpm isrecommended.

Specifying a pnpm Version

To specify thepnpm version for your application builds, , use one of the following methods:

  • Use thepackageManager field inpackage.json

    {  "name": "example-app",  "packageManager": "pnpm@9.0.5"}

This method usesCorepack which is preferred forpnpm tooling. The version declared inpackage.json must be exact but it can be configured from a version range withCorepack’s use command(e.g.;corepack use pnpm@9.x).

  • Use theengines.pnpm field inpackage.json

    {  "name": "example-app",  "engines": {    "pnpm": "9.0.5"  }}

This method allows for version ranges like9.0 or9.x to be used. Ranges can be useful for keeping up to datewith new releases but are not as safe as exact versions when it comes to reliable builds.

Theengines.pnpm method of specifyingpnpm is not currently supported for apps that use Cloud Native Buildpacks.

Using Yarn

If you have ayarn.lock file at the root of your application along withpackage.json, Heroku downloads and installsYarn which will be used to install your dependencies and build your application. The version ofYarnshould alsobe specified but, if not, version1.22.x will be installed.

Yarn Version Policy

AnyYarn version that runs on thesupported Node.js versions can be used for buildingHeroku applications. Older versions ofYarn may continue to work but this is not guaranteed. Using thelatest version ofYarn is recommended.

Specifying a Yarn Version

To specify theYarn version for your application builds, use one of the following methods:

  • Use thepackageManager field inpackage.json

    {  "name": "example-app",  "packageManager": "yarn@4.1.1"}

This method usesCorepack which is preferred forYarn tooling. The version declared inpackage.json must be exact but it can be configured from a version range withCorepack’s use command(e.g.;corepack use yarn@4.x).

  • Use theengines.yarn field inpackage.json

    {  "name": "example-app",  "engines": {    "yarn": "4.1.1"  }}

This method allows for version ranges like4.1 or4.x to be used. Ranges can be useful for keeping up to datewith new releases but are not as safe as exact versions when it comes to reliable builds.

Behavior

For details about how Heroku recognizes and executes Node.js applications, seeNode.js Behavior in Heroku.

Additional Reading

The Heroku Node.js buildpack is open source. For a better technical understanding of how the buildpacks works, check out the classic buildpack source code atgithub.com/heroku/heroku-buildpack-nodejs and the Cloud Native Buildpack atgithub.com/heroku/buildpacks-nodejs.