HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

npm cache — Manage the npm package cache. More information: <https://docs.npmjs.com/cli/npm-cache/>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandnpmcacheclimanagepackagenpm cache

Problem

How to use the npm cache command: Manage the npm package cache. More information: <https://docs.npmjs.com/cli/npm-cache/>.

Solution

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}}


Clear a specific cached item by key:
npm cache clean {{key}}


Clear the entire npm cache:
npm cache clean {{[-f|--force]}}


List cached packages:
npm cache ls


List cached packages matching a specific name and version:
npm cache ls {{name}}@{{version}}


Verify the integrity of the npm cache:
npm cache verify


List all entries in the npx cache:
npm cache npx ls

Code Snippets

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

npm cache clean {{[-f|--force]}}

List cached packages

npm cache ls

List cached packages matching a specific name and version

npm cache ls {{name}}@{{version}}

Context

tldr-pages: common/npm cache

Revisions (0)

No revisions yet.