Skip to content

Instantly share code, notes, and snippets.

@abhinav-nath
Created June 19, 2022 07:37
Show Gist options
  • Save abhinav-nath/427b23caced59916951b7a9c6230431b to your computer and use it in GitHub Desktop.
Save abhinav-nath/427b23caced59916951b7a9c6230431b to your computer and use it in GitHub Desktop.
npm commands

Shorthand

# install
npm i <package>

# uninstall
npm un <package>

# update
npm up <package>

# clean install
npm ci

List globally installed packages

npm list -g --depth=0

Update global packages

To see which packages need updating:

npm outdated -g --depth=0

To update global packages individually:

npm update -g <package> <package> <package>

List available scripts to run

npm run

Update npm

npm install -g npm@latest

Installed versions

npm list # for local packages

Find the version of an installed npm package

npm view <package-name> version

npm view react-redux version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment