npm login
npm,
Syntax
npm login [--registry=url] [--scope=@scope]
Parameters
| Parameters | Description | Examples | Level |
|---|---|---|---|
() |
, | npm login |
Common |
--registry |
registry | npm login --registry=https://npm.pkg.github.com |
Advanced |
--scope |
scope registry | npm login --scope=@myorg --registry=https://npm.pkg.github.com |
Advanced |
Examples
npm
npm login
, and
npm whoami
GitHub Packages
npm login --registry=https://npm.pkg.github.com
GitHub token
npm logout
Common Errors
npm ERR! 401 Unauthorized, token
npm ERR! OTP required2FA,
Tips
- npm Recommended access token
- CI NPM_TOKEN
- .npmrc //registry.npmjs.org/:_authToken=${NPM_TOKEN}