Linux command
npm-unpublish 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Unpublish package version
npm unpublish [package]@[version]
Unpublish entire package
npm unpublish [package] --force
Dry run
npm unpublish [package]@[version] --dry-run
说明
npm unpublish removes a published package or version from the npm registry. Because removing a package can break consumers anywhere in the dependency graph, the registry restricts what may be removed and when. Within 72 hours of publication, you may freely unpublish a version or the entire package. After that, the registry only allows unpublishing if no other package depends on it and the package owner is the sole maintainer; otherwise contact npm support. After unpublishing an entire package, the same name cannot be republished for 24 hours, and any unpublished _name@version_ pair can never be reused.
参数
- --force
- Required to unpublish an entire package (all versions) instead of a single version.
- --dry-run
- Show what would be removed without actually unpublishing.
- --workspace _NAME_
- Run the command in the context of the specified workspace.
- --workspaces
- Run the command across all configured workspaces.
- --help
- Display help information.
FAQ
What is the npm-unpublish command used for?
npm unpublish removes a published package or version from the npm registry. Because removing a package can break consumers anywhere in the dependency graph, the registry restricts what may be removed and when. Within 72 hours of publication, you may freely unpublish a version or the entire package. After that, the registry only allows unpublishing if no other package depends on it and the package owner is the sole maintainer; otherwise contact npm support. After unpublishing an entire package, the same name cannot be republished for 24 hours, and any unpublished _name@version_ pair can never be reused.
How do I run a basic npm-unpublish example?
Run `npm unpublish [package]@[version]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --force do in npm-unpublish?
Required to unpublish an entire package (all versions) instead of a single version.