npm (Node Package Manager)
Package Installation
npm install
: Install a package locally
npm install -g
: Install a package globally
npm install --save
: Install and add to package.json dependencies
npm install --save-dev
: Install and add to package.json devDependencies
Package Management
npm uninstall
: Uninstall a package
npm update
: Update all packages
npm update
: Update a specific package
npm list
: List installed packages
npm list -g --depth=0
: List globally installed packages
npm view
: View package details
npm search
: Search for packages
Project Commands
npm init
: Initialize a new npm project
npm run
: Run a script defined in package.json
Publishing
npm adduser
: Add a registry user account
npm publish
: Publish a package to the registry
Configuration
npm config list
: List the npm configuration
npm config set =
: Set a npm configuration option