clean cache |
npm cache clean |
yarn cache clean |
yarn cache clean |
N/A |
bun pm cache rm |
install from package.json
|
npm install |
yarn [install] |
yarn [install] |
pnpm install |
bun install |
don't read or generate a lockfile |
npm install --no-package-lock |
yarn install --no-lockfile |
yarn install --no-lockfile |
N/A |
bun install --no-save |
don't generate a lockfile |
|
yarn install --pure-lockfile |
yarn install --pure-lockfile |
|
N/A |
lockfile is not updated |
npm ci |
yarn install --frozen-lockfile |
yarn install --immutable |
pnpm install --frozen-lockfile |
bun install --frozen-lockfile |
add package |
npm install <package> [--location=global] |
yarn [global] add <package> |
yarn [global] add <package> |
pnpm add <package> [--global] |
bun add <package> [--global] |
add package as dependencies
|
npm install <package> |
yarn add <package> |
yarn add <package> |
pnpm add <package> |
bun add <package> |
add package as devDependencies
|
npm install <package> --save-dev |
yarn add <package> --dev |
yarn add <package> --dev |
pnpm add <package> --save-dev |
bun add <package> --dev |
add package as optionalDependencies
|
npm install <package> --save-optional |
yarn add <package> --optional |
yarn add <package> --optional |
pnpm add <package> --save-optional |
bun add <package> --optional |
add package as peerDependencies
|
npm install <package> --save-peer |
yarn add <package> --peer |
yarn add <package> --peer |
pnpm add <package> --save-peer |
N/A |
add exact version |
npm install <package> --save-exact |
yarn add <package> --exact |
yarn add <package> --exact |
pnpm add <package> --save-exact |
bun add <package> --exact |
remove package |
npm uninstall <package> [--location=global] |
yarn [global] remove <package> |
yarn [global] remove <package> |
pnpm uninstall <package> [--global] |
bun remove [<package>] [--global] |
remove package as dependencies
|
npm uninstall <package> |
yarn remove <package> |
yarn remove <package> |
pnpm uninstall <package> |
bun remove <package> |
remove package as devDependencies
|
npm uninstall <package> --save-dev |
yarn remove <package> --dev |
yarn remove <package> --dev |
pnpm uninstall <package> --save-dev |
bun remove <package> --dev |
remove package as optionalDependencies
|
npm uninstall <package> --save-optional |
yarn remove <package> --optional |
yarn remove <package> --optional |
pnpm uninstall <package> --save-optional |
bun remove <package> --optional |
remove package as peerDependencies
|
npm uninstall <package> --save-peer |
yarn remove <package> --peer |
yarn remove <package> --peer |
pnpm uninstall <package> --save-peer |
N/A |
update package (no package.json ) |
npm update [<package>] [--location=global] |
yarn [global] upgrade [<package>] |
yarn [global] semver up [<package>] |
pnpm update [<package>] [--global] |
N/A |
upgrade package on package.json
|
npm install <package>@latest [--location=global] |
yarn [global] upgrade <package> --latest |
yarn [global] up <package> |
pnpm update <package> --latest [--global] |
N/A |
upgrade interactive |
N/A |
yarn upgrade-interactive |
yarn upgrade-interactive |
pnpm update --interactive |
N/A |
list all package at the top level |
npm list --depth 0 [--location=global] |
yarn [global] list --depth 0 |
yarn [global] list --depth 0 |
pnpm list --depth 0 [--global] |
bun pm ls |
audit vulnerable dependencies |
npm audit [fix] |
yarn audit |
yarn audit |
pnpm audit [--fix] |
|