Package managers CLI Commands Cheatsheet
Last updated by Noel Varanda (opens in a new tab),
npm
yarn
pnpm
cheatsheet
Here's a handy cheatsheet summarizing the commonly used commands for npm, yarn, and pnpm:
Command | pnpm | yarn | npm |
---|---|---|---|
Install dependencies | pnpm install | yarn install | npm install |
Update dependencies | pnpm update | yarn upgrade | npm update |
Run a script | pnpm run <script-name> | yarn run <script-name> | npm run <script-name> |
Add a development dependency | pnpm add -D <package> | yarn add <package> -D | npm install <package> -D |
Remove a dependency | pnpm remove <package> | yarn remove <package> | npm uninstall <package> |
Check for outdated dependencies | pnpm outdated | yarn outdated | npm outdated |
List installed packages | pnpm list | yarn list | npm list |
Clean cache | pnpm cache clean | yarn cache clean | npm cache clean |
Keep up to date with any latest changes or announcements by subscribing to the newsletter below.