Registry / devops / npm-cache

npm-cache

JSON →
library0.8.0jsnpmunverified

A command-line utility that caches dependencies installed via npm, bower, jspm, and composer to reduce build times. It works by hashing the configuration file (package.json, bower.json, etc.) and storing the resulting tarball in a local cache directory (~/.package_cache by default). On subsequent runs, it extracts the cached tarball instead of re-installing. The latest version is 0.8.0 (last updated in 2017), with no active development. It is a simple, pragmatic solution for CI environments that run installs repeatedly, but lacks tests and modern best practices.

npm install npm-cache
INSTALL
IMPORT
SIG · NPM-CACHE
N
npm-cache
devopsjavascriptv0.8.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

npm-cache (CLI)
npm install -g npm-cache && npm-cache install
require('npm-cache')
This is a CLI tool, not a library. Do not attempt to import it programmatically.

Shows global installation and basic usage of npm-cache CLI to install and cache dependencies.

npm install -g npm-cache cd /path/to/project npm-cache install # On first run, installs dependencies and caches them. # On subsequent runs, restores from cache if configuration unchanged. npm-cache install --cacheDirectory /tmp/cache bower --allow-root npm-cache clean
Debug
Known issues
gotchaCache directory defaults to ~/.package_cache. Ensure it exists and is writable or use --cacheDirectory.
fix
Use --cacheDirectory /path/to/cache to specify a custom location.
affects: >=0.1.0
gotchaOnly caches dependencies after a successful install. If install fails, cache is not updated.
fix
Check that network and permissions are available on first run.
affects: >=0.1.0
gotchaNo support for lockfiles (package-lock.json, yarn.lock). Caching based solely on package.json may lead to inconsistencies.
fix
Use a more modern tool like npm ci with caching or a dedicated CI cache step.
affects: >=0.1.0
deprecatedThe package is not actively maintained. Last release in 2017. No updates for breaking changes in npm or other package managers.
fix
Consider alternatives like npm ci with --prefer-offline or CI-native caching.
affects: >=0.8.0
Errors
Common errors & fixes
Error: EACCES: permission denied, open '/home/user/.package_cache/...'
npm-cache cannot write to default cache directory due to permissions.
fix
Run with sudo or set --cacheDirectory to a user-writable location.
Cannot find module '...' after npm-cache install
Cache restored but lockfile or exact versions mismatch.
fix
Use --forceRefresh to force a fresh install without cache, or ensure package.json is stable.
Command failed: npm install
npm-cache does not handle npm errors gracefully; if npm install fails, cache is not populated.
fix
Check network connectivity and npm configuration, then retry.
Upgrade
Version history
0.8.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
npm-cache — npm install npm-cache · libregistry