search

Home  >  Q&A  >  body text

javascript - How to delete a package that has been published in npm?

npm unpublish
npm unpublish --force //Force deletion, but it seems that it is not actually deleted! ! !
npm unpublish guidest@1.0.1 //Specify the version number, but it doesn’t seem to be deleted

Clear the cache first:
npm cache clean
It doesn’t work either

After the above operations,
I still have this package under my npm account,
I can still install this package through npm install guitest
.

Why is this so?

为情所困为情所困2751 days ago851

reply all(2)I'll reply

  • 阿神

    阿神2017-05-18 11:05:04

    npm unpublish这个命令有的仓储支持,有的仓储不支持。npmjs.org早期也是支持的,但2015年后已经声明过不支持删除已经发布的包,详见npm issue。类似情况推荐使用命令npm deprecate

    reply
    0
  • PHP中文网

    PHP中文网2017-05-18 11:05:04

    Last year, there was a database deletion incident by a big cow, which caused the construction failure of many famous npm packages that relied on it, and even affected the production environment of many companies. Since then, npm has changed its unpublish strategy.
    If I remember correctly, it seems that you can delete the library you published within half an hour, and then you can no longer delete it.
    For detailed information, you can visit their blog on the npm official website.

    reply
    0
  • Cancelreply