heroku / heroku/heroku-buildpack-nodejs
Caching .npm but not node_modules
- Dominant language
- Shell
- Stars
- 1.3k
- Forks
- 2.6k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 30
Description
I tried to read through the code but I'm not familiar enough with it to understand how this works. I'm looking for a way to _both_
- Make sure the .npm cache is cached and restored (or just a confirmation that it _is), and
- **Not** cache `node_modules`.
npm 5 has very fast installs from a warm cache, but I have observed issues with some package upgrades when installing with a pre-existing node_modules. Thus, I want to disable node_modules caching while still keeping the warm .npm cache, to ensure smoother, more consistent builds.
Is this possible? and if yes, how?
Contributor guide
Research direction
Start by tracing how this buildpack currently caches and restores npm data and node_modules; the issue does not name specific files or tests. Confirm whether the .npm cache is retained while node_modules is excluded, and document or implement the supported behavior so installs remain consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100