NPM

From Bonus Bits
Jump to: navigation, search

Description

This article gives some common Node Package Manager command examples.


Global vs Local

Global packages are available anywhere on the system for any project. Local packages are installed in the current working directory in a folder named node_modules by default and are only available in the directory where the package.json file lives.


List Packages

Global

npm list -g

Local

npm list


Install Packages

Global

npm install packagename -g

Local

npm install packagename


List Outdated Packages

Global

npm outdated -g

Local

npm outdated


Update Packages

Global

npm update -g

Local

npm update


Uninstall Packages

Global

npm uninstall packagename -g

Local

npm uninstall packagename


Related Articles


Sources