Must Know NPM Commands
1 MIN READ
Table of contents
NPM List
List installed packages
npm list
or
npm ls
To list globally installed packages
npm list -g
or
npm ls -g
NPM Outdated
Check for outdated packages
npm outdated
Check for outdated global packages
npm outdated -g
NPM Search
Search for packages
npm search @tailwindcss
NPM Prune
Remove unneeded packages
npm prune
NPM Run
List package scripts
npm run
NPM Install Latest
Install the latest version of a package
npm install tailwindcss@latest
Update NPM
Update to the latest NPM version
npm install npm@latest -g
NPM Audit
Run a security audit on installed packages
npm audit
NPM CI
Install a project with a clean slate
Command is similar to npm install
but runs faster. Needs to have package-lock.json
otherwise command will fail. Removes node_modules
before running.
npm ci