Skip to content

Instantly share code, notes, and snippets.

@anselmdk
Last active October 5, 2016 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anselmdk/4403dea36e27c516ffc5 to your computer and use it in GitHub Desktop.
Save anselmdk/4403dea36e27c516ffc5 to your computer and use it in GitHub Desktop.
NPM Cheat Sheet

NPM Cheat Sheet

install

npm install --save PACKAGE
npm install --save-dev PACKAGE

global

#version
npm -v

installed packages

#check what's outdated
npm outdated

#check installed versions
npm list
#check installed package version
npm list mypackage

Update

npm update mypackage

force install

is this the solution? v3 seems to be released

npm install --force

package.json

dependencies

In the simplest terms, the tilde matches the most recent minor version (the middle number). ~1.2.3 will match all 1.2.x versions but will miss 1.3.0. The caret, on the other hand, is more relaxed. It will update you to the most recent major version (the first number). ^1.2.3 will match any 1.x.x release including 1.3.0, but will hold off on 2.0.0.

source

See more under https://docs.npmjs.com/files/package.json#dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment