重命名已发布的 NPM 模块 [英] Renaming a published NPM module

查看:52
本文介绍了重命名已发布的 NPM 模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法重命名已经发布的 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 弃用说明

这篇关于重命名已发布的 NPM 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆