Files
cheatsheet-tldr/tldr/npm-cache
2025-08-03 00:24:25 +00:00

42 lines
732 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# npm cache
> Manage the npm package cache.
> More information: <https://docs.npmjs.com/cli/npm-cache>.
- Add a specific package to the cache:
`npm cache add {{package_name}}`
- Remove a specific package from the cache:
`npm cache remove {{package_name}}`
- Clear a specific cached item by key:
`npm cache clean {{key}}`
- Clear the entire npm cache:
`npm cache clean --force`
- List the contents of the npm cache:
`npm cache ls`
- Verify the integrity of the npm cache:
`npm cache verify`
- Show the cache path:
`npm {{[c|config]}} get cache`
- Change the cache path:
`npm {{[c|config]}} set cache {{path/to/directory}}`