yarn / 3.1.1 / cli / npm / login.html /

yarn npm login

Store new login info to access the npm registry.

Usage

$> yarn npm login

Examples

Login to the default registry :

yarn npm login

Login to the registry linked to the @my-scope registry :

yarn npm login --scope my-scope

Login to the publish registry for the current package :

yarn npm login --publish

Options

Definition
Description
-s,--scope #0 Login to the registry configured for a given scope
--publish Login to the publish registry

Details

This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.

Adding the -s,--scope flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also npmScopes).

Adding the --publish flag will cause the authentication to be done against the registry used when publishing the package (see also publishConfig.registry and npmPublishRegistry).

© 2016–present Yarn Contributors
Licensed under the BSD License.
https://yarnpkg.com/cli/npm/login