返回介绍

How to Change Profile Settings from the CLI

发布于 2019-05-30 13:06:26 字数 1864 浏览 950 评论 0 收藏 0

Requires npm version 5.5.1 or greater.

To view and set profile properties from the Command Line Interface (CLI), use these commands:

npm profile get 
npm profile set <prop> <value>

Viewing & Setting Profile Values

To see your current profile settings, type:

npm profile get

npm displays your profile settings in a table:

npmgetprofile

You can set or modify the following profile properties from the command line:

  • email
  • password
  • fullname
  • homepage
  • freenode
  • twitter
  • github

How to Set a Password from the Command Line

To set a password, type:

npm profile set password

npm will prompt you for your current password, then you can set the new password.

The password must follow these guidelines:

  • longer than 7 characters
  • does not contain part of your username
  • is not one of these How to Set Other Profile Properties

    To set other values, append them to the end of the line as shown:

    $npm profile set fullname nori pat marsupial
    

    npm will prompt for credentials, including a one-time-password if you have enabled two-factor authentication. npm will then confirm that the change has occurred:

    Set fullname to nori pat marsupial
    

    Enabling and Disabling Two-Factor Authentication

    You can also enable and disable two-factor authentication from the command line, using the steps described Notes

    Please refer to the command line documentation for more details and examples.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文