Speeding up GitHub Actions by caching npm dependencies #173418
-
Select Topic AreaQuestion BodyHow do I cache npm dependencies in GitHub Actions? I have a Node.js project with a workflow that installs dependencies using Is there a way to cache the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@WEREWOLF-DEMON Yes 🙂 You can speed up your Node.js workflow by caching npm dependencies with the built-in
This caches the npm folder based on your Alternatively, if you’re using |
Beta Was this translation helpful? Give feedback.
@WEREWOLF-DEMON Yes 🙂 You can speed up your Node.js workflow by caching npm dependencies with the built-in
actions/cache
. Here’s an example:This caches the npm folder based on your
package-lock.json
. When the lockfile changes, the cache updates.Alternatively, if you’re using
npm ci
, this works well with cache too. It can cut install time a lot.