Is there a workaround for `npm publish -f`

拈花ヽ惹草 提交于 2019-12-05 21:00:19

问题


Now that npm publish -f is deprecated, is there a workaround or a package that makes it possible to overwrite a target version after it's been published?

I know about semver; I still want npm publish -f.


回答1:


someone said this on npm's github issue:

@nmrony You cannot overwrite previously-published packages anymore (since February 2014, if I recall correctly).

https://github.com/npm/npm/issues/8305#issuecomment-236412989




回答2:


This will probably not be viable but there's an overkill method

npm unpublish --force - will delete your entire project

wait 24 hours

npm publish




回答3:


You can unpublish a specific version, and then republish it:

npm unpublish myModule@1.2.3

And then republish the version.

This works indefinitely if the module is hosted on your own npm repo, but according to this, there's a time-limit (72 hours) in which you can do it if hosted on registry.npmjs.org.



来源:https://stackoverflow.com/questions/27873515/is-there-a-workaround-for-npm-publish-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!