重命名已发布的 NPM 模块 [英] Renaming a published NPM module
问题描述
有没有办法重命名已经发布的 NPM 模块?我想更改我的模块的名称以更准确地匹配它公开的 API,但不想让已经安装它的人陷入困境.
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 like to leave people who have already installed it in the lurch.
推荐答案
没有任何公开的方法可以做到这一点.当我过去遇到这种情况时,我采取的方法是:
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" "警告:此项目已重命名为 %NewProjectName%.请改用 %NewProjectName% 安装."
npm deprecate %ProjectName%@"<=put-latest-version-here" "WARNING: This project has been renamed to %NewProjectName%. Install using %NewProjectName% instead."
这篇关于重命名已发布的 NPM 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!