Use the NPM Command Line with the Project's NPM Registry
You can use the following NPM commands either on the NPM command line or as a command or series of commands in a UNIX shell build step:
Command | Description |
---|---|
npm install |
Installs a package, and any
packages that it depends on, in the project's NPM
registry.
There are several ways to
use the |
npm publish |
Publishes a package to the
project's NPM registry, so it can be installed by
name. By default, the standard npm
publish command publishes packages to the
public registry. The default behavior can be
overridden by specifying a different default
registry or using a scoped package name.
See npm-publish. |
npm unpublish |
Removes a package version from
the project's NPM registry, deleting its entry and
removing the tarball. If you want to encourage
users to upgrade, consider using the npm
deprecate command instead.
See npm-unpublish. |
npm
audit |
Generates an audit report that
summarizes all known security vulnerabilities in
your NPM packages and dependencies, provides the
necessary NPM commands and recommendations that
will fix these vulnerabilities once they are
applied, and, when used with the npm audit
fix command, will try to apply these
recommendations automatically, wherever
possible.
See npm-audit and Check for Security Vulnerabilities in your Project's NPM Packages and Dependencies. |
npm deprecate |
Updates the project's NPM
registry entry for a specific version or a range
of versions of a package and provides a
deprecation warning to everyone who attempts to
install the deprecated package. You must be the
package owner to use this command.
The format of the command
is:
See npm-deprecate. |
npm dist-tag |
Adds, removes, and enumerates
distribution tags on a package.
See npm-dist-tag. |
npm search |
Searches the project's NPM
registry for packages that match the search terms.
The command searches through package metadata for
all files in the project's NPM registry. Note that
the search API performs local searches only
(searches the private VB Studio NPM registry only). It doesn't search and
return results from the remote proxied public NPM
registry.
See npm-search. |
npm
login |
Allows you to log in to NPM,
creating/modifying entries in the
~/.npmrc file for
authentication.
Note that at least one of the two ways to log in must be configured, that is, you must either provide the required fields (username, password and email) using environment variables or pass them as command line arguments, or both. See npm-cli-login. |
npm logout |
Logs out of the registry.
If you're logged into a registry that supports token-based authentication, this command directs the server to end this token's session, invalidating the token everywhere you're using it, not just for the current environment. If you're logged into a registry that uses basic authentication (username and password), this command clears the credentials in your user configuration. In this case, it only affects the current environment. If See npm-logout. |