gpt4 book ai didi

npm - NPM 版本中的错误 - 将补丁版本列入黑名单

转载 作者:行者123 更新时间:2023-12-01 13:15:54 25 4
gpt4 key购买 nike

假设我们发布了一个 NPM 包,但最终有一个错误说它是版本 1.0.056

有没有办法告诉 NPM 将它列入黑名单,这意味着如果用户在 package.json 中有这个:

^1.0.05

它会尽力只安装 1.0.0571.0.055

想法是当您修补错误时,如果它不影响任何公开的 API,那么没有太多理由对 semver 进行重大更改?或者,也许在另一方面,一个重要的错误修复应该要求对版本进行较小的更改?

显然 NPM 不鼓励人们删除包,我们想要不变性,但除非用户明确请求该版本,否则我希望 NPM 不惜一切代价避免安装它?

最佳答案

npm deprecate以后发现问题覆盖历史版本:

npm deprecate <pkg>[@<version>] <message>

This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it.


如果它刚刚发布(72 小时),那么还有:

npm unpublish [<@scope>/]<pkg>[@<version>]

This removes a package version from the registry, deleting its entry and removing the tarball.

关于npm - NPM 版本中的错误 - 将补丁版本列入黑名单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55072787/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com