heroku / heroku/heroku-buildpack-nodejs

Do not restore cache when using npm ci

Open
#889 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Shell
Stars
1.3k
Forks
2.6k
Avg merge
1d 13h
Merged PRs (30d)
30

Description

With the current implementation of `npm ci` usage too create the build environment and Heroku slug, the buildpack will restore the cache at the beginning of the build and save the cache at the end of the build.

As recommended by the npm docs (https://docs.npmjs.com/cli/v6/commands/npm-ci#description), there should be no `node_modules` before an `npm ci` run because the command will delete the `node_modules` anyways. (The Heroku buildpack will pull `node_modules` from the previous build and restore them to the node_modules directory if the build is configured to use `NODE_MODULES_CACHE`.)

Contributor guide

Open the contributing guide

Research direction

Start by tracing the buildpack's cache restore and save paths for builds using npm ci and NODE_MODULES_CACHE. Done means an npm ci build does not restore node_modules before npm ci runs, while the intended cache behavior is preserved for other builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.