重要提示: 此中文文档针对的是 Yarn 2 版本。
有关 1.x 版本的中文文档,请点击进入 yarn.bootcss.com。
Yarn
yarn addyarn binyarn cache cleanyarn config getyarn config setyarn configyarn constraints queryyarn constraints sourceyarn constraintsyarn dedupeyarn dlxyarn execyarn infoyarn inityarn installyarn linkyarn nodeyarn npm infoyarn npm loginyarn npm logoutyarn npm publishyarn npm tag addyarn npm tag listyarn npm tag removeyarn npm whoamiyarn packyarn patch-commityarn patchyarn plugin import from sourcesyarn plugin importyarn plugin listyarn plugin removeyarn plugin runtimeyarn rebuildyarn removeyarn runyarn searchyarn set resolutionyarn set version from sourcesyarn set versionyarn stageyarn unplugyarn upyarn upgrade-interactiveyarn version applyyarn version checkyarn versionyarn whyyarn workspaceyarn workspaces focusyarn workspaces foreachyarn workspaces list

yarn npm logout

Logout of the npm registry.

Usage

$> yarn npm logout [-s,--scope #0] [--publish] [-A,--all]

Examples

Logout of the default registry :

yarn npm logout

Logout of the @my-scope scope :

yarn npm logout --scope my-scope

Logout of the publish registry for the current package :

yarn npm logout --publish

Logout of all registries :

yarn npm logout --all

Details

This command will log you out by modifying your local configuration (in your home folder, never in the project itself) to delete all credentials linked to a registry.

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

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

Adding the -A,--all flag will cause the deletion to be done against all registries and scopes.