Use built-in npm cache support.
Section: Caching dependencies
Cache npm dependencies with setup-node
yaml
yaml
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npmExplanation
Prefer first-party built-in caching support when available.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Caching dependencies
Upload build output as an artifact
Save files from the workflow run for later download or later jobs.