Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not restore cache when using npm ci #889

Open
danielleadams opened this issue Jan 12, 2021 · 3 comments
Open

Do not restore cache when using npm ci #889

danielleadams opened this issue Jan 12, 2021 · 3 comments

Comments

@danielleadams
Copy link
Contributor

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.)

@git2gus
Copy link

git2gus bot commented Jan 12, 2021

This issue has been linked to a new work item: W-8711501

@fjorgemota
Copy link
Contributor

Maybe a good idea instead of just discarding the cache for node_modules would be just adding a --cache option to the npm ci call passing a directory that the buildpack could use for cache (like Gitlab CI suggests, for instance). So we could have some performance improvement by not doing unnecessary network requests while also having the speedup of the npm ci.

I'm not totally sure if this would be good for another issue or if it could be something that could be added as an enhancement in this issue...

@git2gus
Copy link

git2gus bot commented Feb 9, 2021

This issue has been linked to a new work item: W-8870770

@heroku heroku deleted a comment from git2gus bot Feb 11, 2021
@danielleadams danielleadams removed their assignment Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants