Skip to content

Question: How to properly cache node-gyp builds? #785

Open
@arminrosu

Description

@arminrosu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions