Jump to content

Npm: Difference between revisions

From Torben's Wiki
 
(No difference)

Latest revision as of 07:29, 25 October 2025

pnpm

# better and faster than npm
brew install 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