Jump to content

Npm: Difference between revisions

From Torben's Wiki
 
mNo edit summary
 
Line 2: Line 2:
  # better and faster than npm
  # better and faster than npm
  brew install pnpm
  brew install pnpm
brew upgrade pnpm
  # or  
  # or  
  npm install -g pnpm
  npm install -g pnpm
  # update single package
  # update single package
  pnpm up vite
  pnpm up vite

Latest revision as of 11:33, 4 July 2026

pnpm

# better and faster than npm
brew install pnpm
brew upgrade pnpm

# or 
npm install -g pnpm

# update single package
pnpm up vite
# update all dependencies
pnpm up

npm Packagemanager for Javascript Packages

Globally Installed packages

brew install node

npm install -g prettier eslint cspell
# list global packages
npm ls -g
# update all
npm update -g

Install a package

# install as main package
npm install --save vue
# install as dev package
npm install --save-dev cypress

Update a package

npm update cypress

force update

npm remove cypress
npm install --save-dev cypress

alternative: npm-check-updates

npm i -g npm-check-updates
ncu -u cypress
npm install
# or update all packages
ncu -u
npm install

Windows Error about Execution_Policies

npm.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies

open Admin PowerShell and run

Set-ExecutionPolicy RemoteSigned