你可以从网站或命令行管理用户账户个人资料的设置。
🌐 You can manage settings for your user account profile from the web or command line.
🌐 Managing user account profile settings from the web
在网站上,你可以更改以下用户个人资料设置:
🌐 From the web, you can change the following user profile settings:
🌐 Linking your npm and GitHub accounts
在账户设置页面,你会找到一个用于关联你的 GitHub 账户的按钮。点击它。
如果你当前未登录 GitHub,系统将提示你完成身份验证流程。
成功登录后,或者如果你已经有一个活跃的浏览器会话,你将会被提示“授权 npm 账户关联”,点击该按钮。
你将被重定向到 npm,并且该链接将在你的设置中显示为成功。
🌐 Removing your GitHub account from npm
在账户设置页面,你会找到一个删除你的GitHub账户的按钮。点击它。
注意:点击移除只会从你的 npm 账户中移除链接。你需要从你的 GitHub 应用授权设置 获取 revoke 权限,才能永久地从你的 GitHub 账户中移除该集成
🌐 Managing user account profile settings from the command line
注意: 要通过命令行更改你的账户设置,你的 npm 客户端必须是 5.5.1 或更高版本。要更新到最新版本的 npm,请在命令行中运行 npm install npm@latest -g
🌐 Viewing user account profile settings from the command line
要从 CLI 查看你的用户个人资料设置,请在命令行上运行以下命令:
🌐 To view your user profile settings from the CLI, on the command line, run the following command:
npm profile get
🌐 Updating user account profile settings from the command line
在 CLI 中,你可以更改用户账户的以下属性:
🌐 From the CLI, you can change the following properties for your user account:
emailtwo-factor authfullnamehomepagefreenodepassword在命令行中,输入以下命令,将 property 替换为属性名称,将 value 替换为新值:
npm profile set <prop> <value>
出现提示时,提供你当前的密码。
如果你在账户上启用了双重身份验证,则在出现提示时输入一次性密码。
有关更多详情,请参阅 profile 命令行文档 。
🌐 For more details, see the profile command line documentation.
🌐 Setting a password from the command line
npm profile set password
为了保护你的账户,当你从命令行重置密码时,它必须:
🌐 To protect your account, when you reset your password from the command line, it must:
🌐 Configuring two-factor authentication from the command line
在你的账户上启用双重身份验证有助于防止未经授权访问你的账户和包。
🌐 Enabling two-factor authentication on your account helps protect against unauthorized access to your account and packages.
要从命令行启用、配置和禁用双重身份验证,请参阅“配置双重身份验证”.
🌐 To enable, configure, and disable two-factor authentication from the command line, see "Configuring two-factor authentication".