← 返回命令列表

Linux command

npm-profile 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Show all profile

npm profile get

Get a specific

npm profile get [property]

Set a profile field

npm profile set [field] [value]

Change password

npm profile set password

Enable two-factor authentication

npm profile enable-2fa [auth-only|auth-and-writes]

Disable 2FA

npm profile disable-2fa

Output as JSON

npm profile get --json

说明

npm profile manages your user profile on the npm registry. It can view and update profile settings (email, fullname, homepage, social handles), change your password interactively, and configure two-factor authentication for account security. This command depends on the registry implementation; third-party registries may not support all subcommands.

参数

get _property_
Display all profile properties or one specific property.
set _property_ _value_
Set a profile property. Supported: email, fullname, homepage, freenode, twitter, github.
set password
Interactively change the account password.
enable-2fa _mode_
Enable two-factor authentication. Mode is `auth-only` (login/auth changes) or `auth-and-writes` (also publish, dist-tag, access changes). Default is `auth-and-writes`.
disable-2fa
Disable two-factor authentication.
--registry _URL_
Override the registry URL (default https://registry.npmjs.org/).
--otp _CODE_
Provide a one-time password for 2FA-protected actions.
--json
Output results as JSON.

FAQ

What is the npm-profile command used for?

npm profile manages your user profile on the npm registry. It can view and update profile settings (email, fullname, homepage, social handles), change your password interactively, and configure two-factor authentication for account security. This command depends on the registry implementation; third-party registries may not support all subcommands.

How do I run a basic npm-profile example?

Run `npm profile get` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does get _property_ do in npm-profile?

Display all profile properties or one specific property.