npm (Node Package Manager)
npm is the default package manager for Node.js. It installs third-party packages from the npm registry into node_modules, tracks them in package.json, and runs project scripts like build and test.
Node.js
npm is two things: the world's largest software registry and the command-line tool that talks to it. npm install express downloads Express and its dependencies into node_modules and records it in package.json so anyone can reproduce the setup with a single npm install.
Common commands: npm init creates package.json; npm install adds dependencies (--save-dev for dev-only tools); npm uninstall removes them; npm run <name> executes a script defined in package.json; npm update upgrades within allowed version ranges; and npm ci does a clean, lockfile-exact install for CI.
npm writes a package-lock.json that pins the exact resolved versions of the whole dependency tree, so installs are reproducible. Alternatives like yarn and pnpm use the same registry with different performance and disk strategies, but npm ships with Node by default.
Syntax
npm install <package>
npm run <script>Examples
JavaScript
// terminal
// npm init -y
// npm install express
// npm install --save-dev jest
// npm run test