LinuxCommandLibrary

npm

node Package Manager

TLDR

Install dependencies

$ npm install
copy
Install package
$ npm install [package]
copy
Install globally
$ npm install -g [package]
copy
Install dev dependency
$ npm install -D [package]
copy
Run script
$ npm run [script-name]
copy
Start application
$ npm start
copy
Run tests
$ npm test
copy
Update packages
$ npm update
copy
Initialize project
$ npm init
copy

SYNOPSIS

npm [command] [options]

DESCRIPTION

npm is the Node Package Manager. It manages JavaScript packages and dependencies.
The tool handles package.json. Largest software registry in the world.

PARAMETERS

COMMAND

npm command.
install
Install packages.
uninstall
Remove packages.
run SCRIPT
Run package script.
update
Update packages.
init
Create package.json.
-g
Global installation.
--help
Display help information.

CAVEATS

Requires Node.js. package-lock.json for determinism. Network dependent.

HISTORY

npm was created by Isaac Schlueter in 2010 and is the default package manager for Node.js.

SEE ALSO

npx(1), yarn(1), pnpm(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard