Skip to content

Instantly share code, notes, and snippets.

@trustmaster
Last active February 23, 2017 13:09
Show Gist options
  • Save trustmaster/a3651ddd6540ebb5febb94edd95abd03 to your computer and use it in GitHub Desktop.
Save trustmaster/a3651ddd6540ebb5febb94edd95abd03 to your computer and use it in GitHub Desktop.
NPM shrinkwrap with NoFlo 0.8

Using NPM Shrinkwrap to force NoFlo 0.8

Installing noflo-0.8 for all dependencies

  1. npm install latest dependency tree
  2. npm shrinkwrap to generate initial npmshrinkwrap.json file
  3. In npmshrinkwrap.json find all occurances of "noflo" and replace the contents with e.g.
// ...
"noflo": {
  "version": "0.8.0-beta3",
  "from": "noflo@0.8.0-beta3",
  "resolved": "https://registry.npmjs.org/noflo/-/noflo-0.8.0-beta3.tgz"
// ...
  1. npm install again, which will use npmshrinkwrap.json instead of package.json

Updating a dependency

Say noflo has released a new version and you need to update it in your shrinkwrapped project.

  1. npm update to update from package.json rather than npmshrinkwrap.json (optional)
  2. npm prune to remove "extraneous" packages
  3. npm shrinkwrap to generate a new npmshrinkwrap.json
  4. Edit npmshrinkwrap.json again like you did in step 3 in previous section
  5. npm install based on shrinkwrapped tree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment