Quick Reference for NPM
|
Install node and NPM
|
|
|
Configure Proxy
|
|
|
NPM Documentation
|
|
Install a package and the update package.json with the package name and version
|
npm install <package name> --save
|
|
Install Latest Version of a Package do not update package.json
|
npm install <package name>
|
|
Install Specific Package Version
|
npm install <package-name>@<version-number>
|
|
Install a scoped package
|
npm install @<namespace>/<package-name>
|
|
Install to dev dependencies
|
npm install <package-name> --save-dev
|
|
Install package globally
|
npm install <package-name> -g
|
|
Install from GitHub
|
npm install <GitHub-URL>
|
|
Install from a folder (for private packages)
|
npm install <path>
|
|
Restore packages defined in package.json
|
npm install
|
|
Find the Global Install Directory
|
npm config get prefix
|
|
Uninstall and remove from package.json
|
npm uninstall <package-name> --save
|
|
Uninstall Package
|
npm uninstall <package-name>
|
|
Uninstall Global Package
|
npm uninstall -g <package-name>
|
|
Remove extraneous (unused) packages
|
npm prune
|
|
Clear from the NPM Cache
|
npm cache clean
|
|
List packages used by your application no dependencies
|
npm ls --depth 0
|
|
List packages used by your application with dependencies
|
npm ls
|
|
List packages installed globally no dependencies
|
npm ls -g --depth 0
|
|
List packages and dependencies installed globally
|
npm ls -g true
|
|
List dev dependencies
|
npm ls --dev true
|
|
List prod dependencies
|
npm ls --prod true
|
|
Show the latest version of a package on npm
|
npm view <package-name> version
|
|
Show current version of a local npm package
|
npm show <package-name> version
|
|
Get general help
|
npm -h
|
|
Get help about a command
|
npm <command-name> -h
|
|
Go to help page about command
|
npm help <command-name>
|
|
Go to the repository for the page
|
npm repo <package-name>
|
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.