Skip to content

Caching

How do I cache node_modules?

Quick answer

Cache ~/.npm keyed on package-lock.json, or restore node_modules directly if your install is deterministic.

The detail that matters

Caching node_modules itself is faster but riskier across Node versions. Caching ~/.npm is the safer default.

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.