Renaming a published NPM module

前端 未结 7 1915
礼貌的吻别
礼貌的吻别 2020-12-23 11:14

Is there any way to rename an NPM module that has already been published? I want to change the name of my module to more accurately match the API it exposes but would not li

7条回答
  •  生来不讨喜
    2020-12-23 11:32

    From the documentation:

    Registry data is immutable, meaning once published, a package cannot change. We do this for reasons of security and stability of the users who depend on those packages.

    However newly published packages - within 72 hours - can be unpublished by running:

    npm unpublish  -f
    

    This will remove the package from the NPM registry if it was published less than 72 hours ago. Then you can change your package's name and publish it again.

    Caution: You need to wait 24 hours if you try to republish package with the same name

提交回复
热议问题