弃用和取消弃用包或包版本
如果您不再希望维护一个包,或者如果您想鼓励用户更新到新的或不同的版本,您可以 弃用 它。弃用一个包或版本将在用户安装它时向终端打印一条消息。
弃用警告或消息可以说明任何内容。您可能希望包含一条消息,鼓励用户更新到特定版本或替代的受支持包。
注意:我们强烈建议弃用包或包版本而不是 取消发布 它们,因为取消发布会从注册表中完全删除一个包,这意味着任何依赖它的人都将无法再使用它,而不会发出警告。
弃用整个包
弃用整个包会将其从 npm 网站的搜索结果中删除,并且包页面上也会显示弃用消息。
如果您的包不符合 取消发布要求,则弃用包是删除包的替代方法。
使用网站
kJXgZjER1Pv3sOoxPEFmdstivUOJvjX5+1N9Xob4caPSejdnGDOAeF0TfN/t69VU/tDyCfv6zzjjL8gIcR6CnMAKsaCh6dAaAIi105ePlv0IkuzlUvr0hjWFv83CosZNdF3GpXIn/X7FPm454o4PfeuixVNoQiMeS7gSeJ4SvKs=
tBvS3rbknepwMMrUhTMH6yn4fwXMGpOtHHFRh263e9tAeSvOzAELDc5OiX78qQ3hhupV2/aSM4Q+MhsO4ckPaIAQmqiGxZeMHC1M81h0iaSso8yxmnCThOREUJzGo+dbtl9zCKSPQXBNFxDabBlSkGd3Jy8qN55l1ClZcBCFJhv4ivyyU2ky3q/BOD3V8oIwCKtL3AXFAraMZmJBD1KmIzEOAqipsui+m/9PPZbTLfjt6k+FOH67DkT7pdjypS7E
sSmS9OCgyJYJPX4kSFl0nw==
RjpAM5+09EAJFhqyyaBmcc+tpqcZZfcfhsj5yvWLT85CyrBi0lzUpPAGXAdJA6TQu1HL1n/5h7rTB9GQYt9n/Q==
jkjBudOz1MRZ+OipHrkoaCyS8GRbfxeaA5fy+g5QuF9XOA2U9z0bibYKWa/F2kc4LI/PEYW3ULCZd/s0Z0K/bbk5VKXDhQ5Xp0lNXBDhskE=
使用命令行
Nglzpf9wOwKcZ/JncmeiNBSJNW7SsIiXc2xHiJW/o1c2WguTdDbNEXj+Ku4MREdHELoIpG15bG84atoF8p4nVGXsoftxCIcQ+v08uHJlcyY3nWRNanl43o82Ff0eQpLcYx9qaIe0BRq00KC2o2hO/pkJ4YxcPKjSk1ilwdC6GKMpVw0gvBtUqEf1T7oXYjI4whBkEZDZXql4Rb/mmBiKZsskoeGIh2rEb9djlb2OG6YzydkUwncO2JzrCYqUKpdU
npm deprecate <package-name> "<message>"
dLrEYqKS3ocChK+/PcNxmzzTXf+b1HTeqdfQ0hvhTBZlJmWne4JnH+IpKq+XYvsBs69PVJUtQf/Hzae41Yf92DQoEuhy/KruL5Fk8nUhCrCx+jq/qyAccc+D8phRktlgSUjrOORpKPhUmt/Fv8D7ehavHt8OA+ekWFzlxBTLmd3s9UQ3BVITQo/HjmrFQvFvOqgitq+ll2D8Gs8zkkrA5Ij0q+QPXvSDa6LII9Vk4HfDpXOWHVuh9XlatyhxapJAUeYNMIthx93DZB8dykRmL9UhrRKxEUf/nvG043r4DOM=
弃用单个版本的包
yLLsEyyf1lNSDX7HyJZRcvuGmK+tKiFhe6GqtYJAdjmyYszFBymMz54CIb+MMjDOAa9y68G9WMXxT5IGppoCOpIWNpf+uRJ6rDcbaXdgwpxqFwyXK43akeX/V0uhWZ/0wSIZ3aCjiCyj/jhGis5xGfWFDLu5TQPEpCTOlzPn/ZI=
使用命令行
OHjnbFRP+3RUNfJCkw8BjGgJsm4oY3YhoQeJYK/Xv+opqjaijK5Jr03Ul5PRsUBA01lN1JMLQB6L8iiva5YNXvbXEqEQ8sXZH4CmDX0TgrLgjTmU+r75cGDRUh5gdLsIP7BwxHFUxo97GvlrkF3RFEPSq/lhy/RFrpI6zEmSjT6LFdNlqzkuAQ2hocjyaa5f78Ua80hdqBHxyaUZUtLjW3RZMJOdyakoEcXIG6EhYBiMFoa9qFqr5Wvenh3FPz1YBlbbOShQm3dTcFge8OD/1Vp5CQ+BH1THl/6GZLFeYys=
npm deprecate <package-name>@<version> "<message>"
4cAsGNsW+LrgYOjDvEtVGnuS5AnggYc2QkfWxjCdhFMFoPWIxy0KxCejS75Z6X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