2025-03-14 21:59:59 -06:00
|
|
|
# npm cache
|
|
|
|
|
|
|
|
|
|
> Manage the npm package cache.
|
2026-02-18 06:55:01 -07:00
|
|
|
> More information: <https://docs.npmjs.com/cli/npm-cache/>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Add a specific package to the cache:
|
|
|
|
|
|
|
|
|
|
`npm cache add {{package_name}}`
|
|
|
|
|
|
|
|
|
|
- Clear a specific cached item by key:
|
|
|
|
|
|
|
|
|
|
`npm cache clean {{key}}`
|
|
|
|
|
|
|
|
|
|
- Clear the entire npm cache:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`npm cache clean {{[-f|--force]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- List cached packages:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
`npm cache ls`
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- List cached packages matching a specific name and version:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`npm cache ls {{name}}@{{version}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Verify the integrity of the npm cache:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`npm cache verify`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- List all entries in the npx cache:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`npm cache npx ls`
|