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

No dependency caching when npm ci is used. #1006

Closed
joshwlewis opened this issue May 31, 2022 · 0 comments · Fixed by #1009
Closed

No dependency caching when npm ci is used. #1006

joshwlewis opened this issue May 31, 2022 · 0 comments · Fixed by #1009
Labels

Comments

@joshwlewis
Copy link
Member

Describe the bug

This buildpack currently prefers to install modules with npm ci over npm install. As stated in the npm docs, npm ci completely ignores any existing node_modules folder contents. It prefers instead to install from the global npm cache. However, this buildpack still attempts to persist and restore node_modules from the buildcache. This means we're using cycles, bandwidth and time caching and restoring artifacts that are completely ignored. Additionally, most builds aren't able to take advantage of any npm artifact caching, making them slower on subsequent builds.

To Reproduce
Build any Node.js app that uses npm to install dependencies.

Versions (please complete the following information):

  • Heroku Stack: [heroku-18, heroku-20, heroku-22]
  • Node Version: all
  • NPM or Yarn Version: npm 6+
  • Buildpack Version: heroku/nodejs v170 - heroku/nodejs v196

Additional context

Caching node_modules with npm install still works as intended. For folks wishing to speed up builds with caching, set the environment variable USE_NPM_INSTALL to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant