Question: How to properly cache node-gyp builds?
@v-gowridurgad is already working on this.
Since Sep 9, 2026.
- Dominant language
- TypeScript
- Stars
- 5k
- Forks
- 1.7k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 2
Description
Hello,
Description:
I'm struggling to figure out how to properly cache node-gyp builds. This adds +30s to my yarn install, by rebuilding them every time yarn install runs.
After manually caching and restoring the build paths, it still triggers a new gyp build every yarn install. The paths I cached:
# Cache location of node headers
~/.cache/node-gyp
# Explicit caching of the affected packages
node_modules/cpu-features/build
node_modules/unix-dgram/build
My previous question in the node-gyp repo lead me here. The suggestion was to look into node-gyp-build.
Any advice would be appreciated.
Justification:
Save myself time and the planet by not wasting electricity.
Are you willing to submit a PR?
Of course.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.