npm-adduser

Synopsis提要
npm adduseralias: add-user
Note: This command is unaware of workspaces.注意:此命令不知道工作空间。

Description描述
Create a new user in the specified registry, and save the credentials to the 在指定的注册表中创建一个新用户,并将凭据保存到.npmrc
file. .npmrc
文件中。If no registry is specified, the default registry will be used (see registry).如果未指定注册表,则将使用默认注册表(请参阅注册表)。
When using 当使用legacy
for your auth-type
, the username, password, and email are read in from prompts.legacy
用于auth-type
时,会从提示中读取用户名、密码和电子邮件。

Configuration配置

registry
- Default: "https://registry.npmjs.org/"
- Type: URL
The base URL of the npm registry.npm注册表的基本URL。

scope
Default: the scope of the current project, if any, or ""默认值:当前项目的范围(如果有),或“”- Type: String
Associate an operation with a scope for a scoped registry.将操作与作用域注册表的作用域相关联。
Useful when logging in to or out of a private registry:在登录或注销私人注册表时很有用:
# log in, linking the scope to the custom registrynpm login --scope=@mycorp --registry=https://registry.mycorp.com# log out, removing the link and the auth tokennpm logout --scope=@mycorp
This will cause 这将导致@mycorp
to be mapped to the registry for future installation of packages specified according to the pattern @mycorp/package
.@mycorp
映射到注册表,以便将来安装根据模式@mycorp/package
指定的包。
This will also cause 这也将导致npm init
to create a scoped package.npm init
创建一个作用域的包。
# accept all defaults, and create a package named "@foo/whatever",# instead of just named "whatever"npm init --scope=@foo --yes

auth-type
- Default: "web"
- Type: "legacy" or "web"
What authentication strategy to use with login
. login
时使用的身份验证策略。Note that if an 请注意,如果给定了otp
config is given, this value will always be set to legacy
.otp
配置,则该值将始终设置为legacy
。