Heroku's official Cloud Native Buildpack for executing npm install
.
The buildpack will pass detection if:
- A
package-lock.json
file is found at the root of the application source.
Node modules downloaded during the install step will be cached. Subsequent builds will use this cache speed up installs.
Node modules are installed by executing npm ci --production=false
.
The following scripts will be executed with npm run <script>
in the order listed:
heroku-prebuild
heroku-build
orbuild
(if both are present, onlyheroku-build
will execute)heroku-postbuild
If any of the above scripts are not defined in package.json
they will be skipped.
If there is a start
script defined in package.json
a default web
process will be
added that executes npm start
.
Name | Description |
---|---|
node_modules |
Allows other buildpacks to depend on the Node modules provided by this buildpack. |
node_build_scripts |
Allows other buildpacks to depend on the build script execution behavior provided by this buildpack. |
Name | Description |
---|---|
node |
To execute npm a Node.js runtime is required. It can be provided by the heroku/nodejs-engine buildpack. |
npm |
To install node modules, the npm package manager is required. It can be provided by either the heroku/nodejs-engine or heroku/nodejs-npm-engine buildpacks. |
node_modules |
This is not a strict requirement of the buildpack. Requiring node_modules ensures that this buildpack can be used even when no other buildpack requires node_modules . |
node_build_scripts |
This is not a strict requirement of the buildpack. Requiring node_build_scripts ensures that this buildpack will perform build script execution even when no other buildpack requires node_build_scripts . |
enabled
(boolean, optional)
[[requires]]
name = "node_build_scripts"
[requires.metadata]
enabled = false # this will prevent build scripts from running
See LICENSE file.