Linux command
npm-logout 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Logout from npm
npm logout
Logout from specific registry
npm logout --registry=[https://registry.example.com]
Logout from scope
npm logout --scope=[@myorg]
说明
npm logout invalidates and removes the authentication token for the configured registry. For tokens issued by npm login, the registry is also notified to revoke the token server-side. The local .npmrc entry for the registry is then deleted. When the configured auth was a legacy username/password (basic auth), only the local credential is removed — there is nothing to revoke on the server.
参数
- --registry _URL_
- Registry to logout from.
- --scope _SCOPE_
- Scoped registry.
- --help
- Display help information.
FAQ
What is the npm-logout command used for?
npm logout invalidates and removes the authentication token for the configured registry. For tokens issued by npm login, the registry is also notified to revoke the token server-side. The local .npmrc entry for the registry is then deleted. When the configured auth was a legacy username/password (basic auth), only the local credential is removed — there is nothing to revoke on the server.
How do I run a basic npm-logout example?
Run `npm logout` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --registry _URL_ do in npm-logout?
Registry to logout from.