Jump to content

Pnpm Node Package Manager: Difference between revisions

From Torben's Wickie
No edit summary
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Install / Update ==
brew install pnpm
brew upgrade pnpm
# update packages.json -> packageManager
pnpm self-update
==Commands==
==Commands==
  # install packages locally
  # install packages locally
Line 11: Line 17:
  # update all packages to latest version
  # update all packages to latest version
  pnpm up --latest
  pnpm up --latest
# or
pnpm up -L
   
   
  # run package
  # run package
Line 23: Line 31:
  # check used packages for vulnerabilities
  # check used packages for vulnerabilities
  pnpm audit
  pnpm audit
  pnpm audit --fix
  pnpm audit --fix update
  pnpm install
  pnpm install

Latest revision as of 11:21, 29 August 2026

Install / Update

brew install pnpm
brew upgrade pnpm
# update packages.json -> packageManager
pnpm self-update

Commands

# install packages locally
pnpm install
# add package
pnpm add vue
# add dev package
pnpm add -D vitest

# update all packages to latest minor version
pnpm up
# update all packages to latest version
pnpm up --latest
# or
pnpm up -L

# run package
pnpm exec vitest --watch=false

# run script (defined in package.json)
pnpm run myscript

# run without installing to repo
pnpx cowsay Moin

# check used packages for vulnerabilities
pnpm audit
pnpm audit --fix update
pnpm install