选择命令行版本:
🌐 Synopsis
npm owner add <user> <package-spec>npm owner rm <user> <package-spec>npm owner ls <package-spec>alias: author
🌐 Description
管理已发布包的所有权。
🌐 Manage ownership of published packages.
请注意,访问权限只有一个级别。要么你可以修改一个软件包,要么你不能。未来的版本可能会包含更细化的访问级别,但目前尚未实现。
🌐 Note that there is only one level of access. Either you can modify a package, or you can't. Future versions may contain more fine-grained access levels, but that is not implemented at this time.
如果你在 auth-and-writes 上启用了两步验证(请参见 npm-profile),那么在更改所有权时需要经过第二因素流程,或者在命令行中使用 --otp 包含一次性密码。
🌐 If you have two-factor authentication enabled with auth-and-writes (see npm-profile) then you'll need to go through a second factor flow when changing ownership or include an otp on the command line with --otp.
🌐 Configuration
registrynpm 注册表的基本 URL。
🌐 The base URL of the npm registry.
otp这是来自双因素认证器的一次性密码。在使用 npm access 发布或更改软件包权限时需要此密码。
🌐 This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with npm access.
如果未设置,并且注册表响应失败并询问一次性密码,npm 将在命令行上提示输入一次密码。
🌐 If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one.
workspace启用在当前项目的已配置工作区的上下文中运行命令,同时通过仅运行此配置选项定义的工作区进行过滤。
🌐 Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option.
workspace 配置的有效值为以下之一:
🌐 Valid values for the workspace config are either:
对于 npm init 命令设置时,可以将其设置为一个尚不存在的工作区文件夹,以创建该文件夹并将其作为项目内全新的工作区进行设置。
🌐 When set for the npm init command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project.
此值不会导出到子进程的环境中。
🌐 This value is not exported to the environment for child processes.
workspaces设置为 true 以在 所有 配置的工作区上下文中运行命令。
🌐 Set to true to run the command in the context of all configured workspaces.
将此显式设置为 false 会导致像 install 这样的命令完全忽略工作区。如果不显式设置:
🌐 Explicitly setting this to false will cause commands like install to ignore workspaces altogether. When not set explicitly:
node_modules 树操作的命令(安装、更新等)会将工作区链接到 node_modules 文件夹。- 执行其他操作的命令(测试、执行、发布等)会在根项目上运行,除非 在 workspace 配置中指定了一个或多个工作区。此值不会导出到子进程的环境中。
🌐 This value is not exported to the environment for child processes.
🌐 See Also