LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

npm-login

authenticates with an npm registry

TLDR

Login to npm registry
$ npm login
copy
Login to specific registry
$ npm login --registry=[https://registry.example.com]
copy
Login with scope
$ npm login --scope=@[myorg]
copy
Check login status
$ npm whoami
copy
Logout
$ npm logout
copy

SYNOPSIS

npm login [options]

DESCRIPTION

npm login (also npm adduser) authenticates with an npm registry. Credentials are stored in ~/.npmrc and used for publishing and accessing private packages.For npmjs.com, this enables publishing packages and accessing private organization packages. The command `npm adduser` is an alias for `npm login`.

PARAMETERS

--registry url

Registry URL.
--scope scope
Associate login with scope.
--auth-type type
Authentication type (legacy, web).

AUTHENTICATION FLOW

$ # Standard login
npm login
# Enter username, password, email, OTP if enabled

# Verify
npm whoami
# Output: your-username

# View token
npm token list
copy

NPMRC LOCATIONS

$ ~/.npmrc           # User config
./.npmrc           # Project config
/etc/npmrc         # Global config
copy

INSTALL

sudo pacman -S npm
copy
sudo apk add npm
copy
brew install npm
copy

CAVEATS

Tokens stored in plaintext in .npmrc. Use npm token for token management. 2FA may be required.

HISTORY

npm login has been part of npm since its early versions, evolving to support 2FA and multiple registries.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid