Renaming a published NPM module

There isn't any exposed way to do that. When I've encountered this in the past the approach I took was:

npm deprecate %ProjectName%@"<=put-latest-version-here" "WARNING: This project has been renamed to %NewProjectName%. Install using %NewProjectName% instead."

npm Deprecate instructions


In simple words no you can't. But npm provides you a different solution called npm deprecate.

What it does is it marks a particular version or version ranges of that package as deprecated. So next if someone tries to install this package they get a warning package deprecated along with your custom message, in which you can easily specify your new package name.

Usage:

npm deprecate my-package-name@"< latest-version" "your message"

Your message can be any thing like:

WARNING: This project has been renamed to your-new-package-name. Install using new-package-name instead.

In less than 24 hours i ran following command to delete wrong package.

npm unpublish <wrong package name> --force