2025-03-14 21:59:59 -06:00
|
|
|
# npm cache
|
|
|
|
|
|
|
|
|
|
> Manage the npm package cache.
|
2025-09-14 18:48:49 -06: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}}`
|
|
|
|
|
|
|
|
|
|
- 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:
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`npm {{[c|config]}} get cache`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Change the cache path:
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`npm {{[c|config]}} set cache {{path/to/directory}}`
|