npm-shrinkwrap based npm package manager for installing modules while offline or experiencing issues with npm.
@infinitylist/installer uses npm-shrinkwrap and points your package-lock.json at npm
tarballs checked into your project's source control, so you can install while offline, during a registry outage, or
during the next left-pad incident.
- Read
package-lock.jsonornpm-shrinkwrap.json. - Download the exact same .tgz files that
npm installfetches from registry.npmjs.org. - Decompress the .tgz files into .tar files. This avoids storing binary files
in Git and removes the cost of decompression during
npm install. - Store the .tar files in your project at
node_modules/*.tar. - Rewrite
package-lock.jsonto point at those instead of the registry.
Now your project can be installed while completely offline:
- npm install
+ npm ci --offlineThe rest of the npm installation process is exactly the same. The only
difference is that no network activity is necessary when installing and building
your project. The node_modules directory can be ignored in your editor
(much like is done with the node_modules directory), but is instead checked
into source control.
Requires npm@7 or higher.
npm install --global @infinitylist/installer
npm shrinkwrap
Run ipm every time you have modified and installed your dependencies to
produce a new package-lock.json.
Usage: ipm [options] [directory]
Options:
-V, --version output the version number
-h, --help display help for command