为了确保你的账户和软件包安全,我们强烈建议撤销(删除)你不再需要或已被泄露的令牌。你可以撤销你创建的任何令牌,包括细粒度访问令牌。
🌐 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, including granular access tokens.
🌐 Revoking tokens on the website
🌐 Revoking tokens using the CLI
要查看令牌列表,请在命令行上运行:
npm token list
在令牌表中,找到并复制要删除的令牌的 ID。
在命令行中运行以下命令,将 123456 替换为你想要删除的令牌的 ID:
npm token delete 123456
npm 将报告 Removed 1 token
要确认令牌已被删除,请运行:
npm token list
注意: 删除令牌时必须使用令牌 ID,而不是令牌的截断版本。在某些情况下,令牌被成功撤销可能会延迟长达一小时。