Skip to content

Node.js Package Manager

Package commands

  • List installed local packages:

      npm ls --depth=0
  • List installed global packages:

      npm ls -g --depth=0
  • List installed global packages with extended information:

      npm ll -g --depth=0

Repository commands

  • Install package ‘pkg’:

      npm install -g <pkg>
  • Upgrade all global packages:

      npm update -g
  • Upgrade global package ‘pkg’:

      npm update -g <pkg>
  • Uninstall package ‘pkg’:

      npm uninstall <pkg>
  • Search packages whose name or description contains ‘string’:

     npm search <string>

Information

  • Show information about package ‘pkg’:

      npm view <pkg>
  • Read documentation of package ‘pkg’:

      npm docks <pkg>