2024-10-27 08:40:49 +05:30
|
|
|
# npm cache
|
|
|
|
|
|
|
|
> Manage the npm package cache.
|
|
|
|
> More information: <https://docs.npmjs.com/cli/commands/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`
|
|
|
|
|
2024-12-28 14:02:37 +08:00
|
|
|
- Show the cache path:
|
2024-10-27 08:40:49 +05:30
|
|
|
|
2024-12-28 14:02:37 +08:00
|
|
|
`npm config get cache`
|
2024-10-27 08:40:49 +05:30
|
|
|
|
|
|
|
- Change the cache path:
|
|
|
|
|
|
|
|
`npm config set cache {{path/to/directory}}`
|