Scroll to navigation

NPM-LOGIN(1) General Commands Manual NPM-LOGIN(1)

NAME

npm-login

Synopsis

<!-- AUTOGENERATED USAGE DESCRIPTIONS -->

Description

Verify a user in the specified registry, and save the credentials to the
.npmrc file.
If no registry is specified, the default registry will be used (see config).

When you run npm login, the CLI automatically generates a legacy token of publish type.
For more information, see About legacy tokens.

When using legacy for your auth-type, the username and password, are read in from prompts.

To reset your password, go to https://www.npmjs.com/forgot

To change your email address, go to https://www.npmjs.com/email-edit

You may use this command multiple times with the same user account to authorize on a new machine.
When authenticating on a new machine, the username, password and email address must all match with your existing record.

Configuration

<!-- AUTOGENERATED CONFIG DESCRIPTIONS -->

See Also

  • npm registry
  • npm config
  • npmrc
  • npm owner
  • npm whoami
  • npm token
  • npm profile

March 2026 11.12.1