[DEPRECATED] Just use Yarn instead.
Offline npm install
, using locally cached packages.
The idea is based on npm-cache, but instead of caching whole node_modules
directory, npm-cache-install
will cache each package seperately, so changing any of them will not invalidate whole cache.
Also, any npm options will be passed to npm install
(like --registry
, etc.)
Run it instead of npm install [options]
, it will:
- read
package.json
, get a list of dependencies - for each dependency
- if already installed and satisfies specified version, continue
- if cached in cache directory (
~/.npm-cache-install
), restore to./node_modules/[dependency]
, continue - actually runs
npm install dependency@version [options]
, - save installed package to cache directory
rm -rf
cache directory for you.
- Windows is not supported for now
- Does not differentiate node version and node architecture (if node version changes, please clean cache directory manually)
- Bad support for
peerDependency
, which might cause problems. - Not tested with npm@3
Issues and PRs are welcomed
- add: 'clean' command
- fix: git/github/http(s) dependencies support
- fix: problem when handling intallation failure