[BUG] `npm unpublish <package>@<version> -f` unpublishes all versions
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
Hello!
Yesterday I published a new version of my package: sequential-workflow-designer. After the publication, I found a bug so I wanted to delete this version and publish the fixed version. I executed this command:
npm unpublish sequential-workflow-designer@0.15.0 -f
Unfortunately the version in the command has not been taken into account, and npm unpublished the whole package.
Expected Behavior
The cli should unpublish only the specific version.
Steps To Reproduce
npm unpublish <package>@<version> -f
Environment
- npm: 9.6.7
- Node.js: v18.17.0
- OS Name: macOS Ventura 13.5 (22G74)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing npm unpublish <package>@<version> -f with npm 9.6.7 and inspect the npm CLI implementation for the unpublish command. Trace how the package and version arguments are parsed, then add a regression test showing that only the requested version is removed while other versions remain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100