npm

npm

Information

Show npm version and help

npm -v
npm help

Search for node packages

npm search <package>

Show information for a package

npm info <package>

Show available versions or publish dates for a package

npm view <package> versions --json
npm view <pacakge> time --json

Show location of global modules folder

npm root --global

Open home page or github repo for package

npm home <package>
npm repo <package>

Check if npm requires updating

List

List installed packages (local / global)

List only top level global packages

Init

Initialize package config in current folder (-y or --yes for default setup)

Install

Install all configured package.json dependencies (dev and production)

Install configured package.json dependencies for specific mode

Install new local package

Install new dev (-D), prod (-P), optional (-O) or global (-g) package

Install without saving reference in package.json

Install specific version

Uninstall

Uninstall package (local, dev, global)

Remove packages not declared in package.json

Update

Update all packages or specific package (local, global)

Show outdated packages

Scripts

package.json default script options

Other scripts require "run"

When executing scripts pre and post versions will automatically run if defined

Global Packages and Cache

Clear the global cache

Command Aliases

  • npm i (npm install)

  • -g (--global)

  • -D (--save-dev)

Configuration

Global configuration file

Set npm configuration values for specified keys

Manage package.json init defaults

Set default init config values

Show default init config values

Delete default init config values

Last updated