Skip to content

Latest commit

 

History

History
65 lines (41 loc) · 6.43 KB

File metadata and controls

65 lines (41 loc) · 6.43 KB

Heroku Cloud Native npm Install Buildpack

CI Registry

Heroku's official Cloud Native Buildpack for executing npm install.

How it works

The buildpack will pass detection if:

  • A package-lock.json file is found at the root of the application source.

Step 1: Configure npm cache

Node modules downloaded during the install step will be cached. Subsequent builds will use this cache speed up installs.

Step 2: Install Node modules

Node modules are installed by executing npm ci --production=false.

Step 3: Execute build scripts

The following scripts will be executed with npm run <script> in the order listed:

  • heroku-prebuild
  • heroku-build or build (if both are present, only heroku-build will execute)
  • heroku-postbuild

If any of the above scripts are not defined in package.json they will be skipped.

Step 4: Configure processes

If there is a start script defined in package.json a default web process will be added that executes npm start.

Build Plan

Requires

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.

Provides

Name Description
node_modules Allows other buildpacks to depend on the Node modules provided by this buildpack.

License

See LICENSE file.