为了确保你的账户和包安全,我们强烈建议你撤销(删除)你不再需要或已被盗用的令牌。你可以撤销你创建的任何令牌。
¥To keep your account and packages secure, we strongly recommend revoking (deleting) tokens you no longer need or that have been compromised. You can revoke any token you have created.
-
要查看令牌列表,请在命令行上运行:
¥To see a list of your tokens, on the command line, run:
npm token list
-
在令牌表中,找到并复制要删除的令牌的 ID。
¥In the tokens table, find and copy the ID of the token you want to delete.
-
在命令行上,运行以下命令,将
123456
替换为要删除的令牌的 ID:¥On the command line, run the following command, replacing
123456
with the ID of the token you want to delete:npm token delete 123456
npm 会报告
Removed 1 token
¥npm will report
Removed 1 token
-
要确认令牌已被删除,请运行:
¥To confirm that the token has been removed, run:
npm token list
注意:你必须使用令牌 ID 来删除令牌,而不是令牌的截断版本。在某些情况下,成功撤销令牌之前可能会有长达一小时的延迟。
¥Note: You must use the token ID to delete a token, not the truncated version of the token. In some cases, there may be a delay of up to an hour before a token is successfully revoked.