Npm Cheatsheet

Npm Cheatsheet

Post Date : 2022-09-20T17:09:13+07:00

Modified Date : 2022-09-20T17:09:13+07:00

Category: cheatsheet

Tags:

Basic commands

Global

list global installed packages

npm list -g

list global installed packages without their dependencies

npm list -g --depth=0

check a specific global package

npm list -g express

install global packages

npm install -g <package_name>

check outdated global packages

npm outdated -g --depth=0

update global package

npm update -g <package_name>

uninstall global package

npm uninstall -g <package_name>

Local

list local installed packages

npm list

list local installed packages without their dependencies

npm list --depth=0

check a specific local package

npm list express

install local package and save to package.json

npm install -S <package_name>

check outdated local package

npm outdated --depth=0

update local package and save to package.json

npm update -S <package_name>

uninstall local package and save to package.json

npm uninstall -S <package_name>