Heroku's official Cloud Native Buildpack for Node.js.
This buildpack is designed to work in conjunction with other buildpacks like
heroku/nodejs-npm
or heroku/nodejs-yarn
,
or independently with simple Node.js with vendored or no dependencies. This
buildpack is part of the heroku/nodejs
meta-buildpack,
which is the default and recommended Cloud Native Buildpack for Node.js apps.
This buildpack installs the Node.js distribution based on the engines.node
property of an app's package.json
. The distribution of Node.js includes node
,
npm
, npx
, and corepack
. All of these commands will be available on
$PATH
. The versions of npm
, npx
, and corepack
installed by this
buildpack will be the same that were packaged with Node.js.
To install a different version of npm
and/or npx
, or to install node_modules
with npm install
, additionally use the heroku/nodejs-npm
buildpack. Alternatively, use the heroku/nodejs
meta-buildpack, which includes both buildpacks.
To install yarn
and/or install node_modules
with yarn
, additionally use
the heroku/nodejs-yarn
buildpack. Alternatively, use the heroku/nodejs
meta-buildpack, which includes both buildpacks.
This buildpack's bin/detect
always passes. However, the overall group detection
may fail based on provides
and requires
.
This buildpack provides
node
. If a package.json
, index.js
, and/or
server.js
is detected, this buildpack will also set node
as a requires
entry.
$PATH
will be modified such that node
, npm
, npx
, and corepack
are
available.
$WEB_MEMORY
will be set to a reasonable default at runtime. This value is
used to determine the correct $WEB_CONCURRENCY
.
$WEB_CONCURRENCY
will be set to a reasonable default at runtime. This variable
may be used in the application to set the number of workers for apps that
use them.
To build an app locally into an OCI Image with this buildpack, use the pack
command from Cloud Native Buildpacks:
pack build example-app-image --buildpack heroku/nodejs-engine --path /some/example-app
For development, dependencies, contribution, license and other info, please refer to the root README.md.