Skip to content
Roger Xu edited this page Apr 3, 2016 · 4 revisions

Commands

List

List installed packages

$ npm ls --depth 0

Search

Search package

npm search eslint

Install

Install package

$ npm install eslint@latest -D

Upgrade

Check outdated packages

$ npm outdated --depth 0

Upgrade all packages

$ npm update --depth Infinity

Uninstall

Uninstall package

$ npm uninstall eslint

Cache

Get cache path

$ npm config get cache
$HOME/.npm

Get cache list

$ npm cache ls

Clear cache

$ npm cache clean

Packages

Global Packages

Local Packages

dependencies

devDependencies

Install Package Process

  1. npm install
  2. npm query from registry
  3. Download package to ~/.npm directory
  4. Extract package to node_modules directory