npm
JavaScript and Node.js package manager. Manage Node.js projects and their module dependencies.
More info →Subcommands (67)
Set access level on published packages.
Add a registry user account.
Scan project dependencies for known security vulnerabilities.
This command is an alias of `npm owner`.
Report bugs for a package in a web browser. Attempts to open the package's bug tracker URL or support email.
Manage the npm package cache.
Check for outdated, incorrect, and unused npm package dependencies.
Clean install of `npm` project dependencies for automated environments. Installs packages based on `package-lock.json` or `npm-shrinkwrap.json`.
Enable or set up tab-completion for npm commands.
Manage the `npm` configuration settings.
Reduce duplication in the `node_modules` directory.
Mark a version or range of versions of an `npm` package as deprecated.
Compare package versions from the `npm` registry and show differences. Similar to `git diff`.
Open the documentation for one or more packages in the default web browser.
Check the health of the npm environment.
Select a dependency in the current project and open the package folder in the default editor (`$EDITOR`). After editing, the package is rebuilt to pick up any changes in compiled packages.
Execute binaries from `npm` packages.
Explain how a package is installed, detailing its dependencies and reasons for inclusion.
Browse an installed npm package.
Retrieve funding information from packages.
Display an overview of `npm` syntax, frequently used commands, and a short description of each command.
Open the `npm` page, Yarn page, or GitHub repository of a package in the web browser.
Manage `npm` registry hooks for packages. Note: This command has been deprecated.
Create a `package.json` file.
Install Node packages.
This command is an alias of `npm install-test`.
Symlink a local package into the global `node_modules` or another project for development.
This command is an alias of `npm ls`.
Log in to a registry user account. See also: `npm logout`.
Log out of the registry user account. See also: `npm login`.
Print installed packages to `stdout`.
Check whether a package or organization name is available on npm.
Manage organizations.
Check for outdated npm package dependencies.
Manage ownership of published packages.
Create a tarball from a package.
Ping `npm` registry.
Show or modify `package.json` properties.
Print the local or global prefix to `stdout`.
Manage the npm profile and related settings. Note: This command is unaware of workspaces.
Remove extraneous packages from `node_modules`. Note: Extraneous packages are those present in the node_modules folder that are not listed as any package's dependency list.
Publish a package to the npm registry.
Print an array of dependency objects using CSS-like selectors.
This command is an alias of `npm-rebuild`.
Rebuild native Node.js packages after Node or dependency changes.
Open the repository page of a package in the browser.
This command is an alias of `npm run restart`.
Display path to `node_modules` directory.
Run a script.
Generate a Software Bill of Materials (SBOM) for your Node.js project.
Search for packages in the `npm` registry.
Lock down the dependencies of a package, creating a `npm-shrinkwrap.json` file. Similar to `package-lock.json` but intended for published packages.
Mark a package as favorite.
View packages marked as favorites.
This command is an alias of `npm run start`.
This command is an alias of `npm run stop`.
Manage teams in an organization on the `npm` registry.
This command is an alias of `npm run test`.
Manage and generate authentication tokens for the npm registry.
Remove a package.
Remove a package from the npm registry.
Remove the favorite/star mark from a package.
Update packages in the current project.
Bump a node package version.
View registry information about a package.
Display npm username.
Identifies why an npm package is installed.
Options (6)
-y, --yesbooleanCreate a `package.json` file with default values (omit `--yes` to do it interactively)
npm init {{[-y|--yes]}}booleanDownload all the packages listed as dependencies in `package.json`
npm {{[i|install]}}-D, --save-devbooleanDownload the latest version of a package and add it to the list of dev dependencies in `package.json`
npm {{[i|install]}} {{package_name}} {{[-D|--save-dev]}}-g, --globalbooleanDownload the latest version of a package and install it globally (set the install location with `npm config set prefix`)
npm {{[i|install]}} {{package_name}} {{[-g|--global]}}booleanUninstall a package and remove it from the list of dependencies in `package.json`
npm {{[r|uninstall]}} {{package_name}}booleanList all locally installed dependencies
npm {{[ls|list]}}Examples (8)
Create a `package.json` file with default values (omit `--yes` to do it interactively)
npm init [-y|--yes]Download all the packages listed as dependencies in `package.json`
npm [i|install]Download a specific version of a package and add it to the list of dependencies in `package.json`
npm [i|install] package_name@versionDownload the latest version of a package and add it to the list of dev dependencies in `package.json`
npm [i|install] package_name [-D|--save-dev]Download the latest version of a package and install it globally (set the install location with `npm config set prefix`)
npm [i|install] package_name [-g|--global]Uninstall a package and remove it from the list of dependencies in `package.json`
npm [r|uninstall] package_nameList all locally installed dependencies
npm [ls|list]List all top-level globally installed packages
npm [ls|list] [-g|--global] --depth 0