npm-unpublish.html 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <html><head>
  2. <title>npm-unpublish</title>
  3. <style>
  4. body {
  5. background-color: #ffffff;
  6. color: #24292e;
  7. margin: 0;
  8. line-height: 1.5;
  9. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  10. }
  11. #rainbar {
  12. height: 10px;
  13. background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff);
  14. }
  15. a {
  16. text-decoration: none;
  17. color: #0366d6;
  18. }
  19. a:hover {
  20. text-decoration: underline;
  21. }
  22. pre {
  23. margin: 1em 0px;
  24. padding: 1em;
  25. border: solid 1px #e1e4e8;
  26. border-radius: 6px;
  27. display: block;
  28. overflow: auto;
  29. white-space: pre;
  30. background-color: #f6f8fa;
  31. color: #393a34;
  32. }
  33. code {
  34. font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
  35. font-size: 85%;
  36. padding: 0.2em 0.4em;
  37. background-color: #f6f8fa;
  38. color: #393a34;
  39. }
  40. pre > code {
  41. padding: 0;
  42. background-color: inherit;
  43. color: inherit;
  44. }
  45. h1, h2, h3 {
  46. font-weight: 600;
  47. }
  48. #logobar {
  49. background-color: #333333;
  50. margin: 0 auto;
  51. padding: 1em 4em;
  52. }
  53. #logobar .logo {
  54. float: left;
  55. }
  56. #logobar .title {
  57. font-weight: 600;
  58. color: #dddddd;
  59. float: left;
  60. margin: 5px 0 0 1em;
  61. }
  62. #logobar:after {
  63. content: "";
  64. display: block;
  65. clear: both;
  66. }
  67. #content {
  68. margin: 0 auto;
  69. padding: 0 4em;
  70. }
  71. #table_of_contents > h2 {
  72. font-size: 1.17em;
  73. }
  74. #table_of_contents ul:first-child {
  75. border: solid 1px #e1e4e8;
  76. border-radius: 6px;
  77. padding: 1em;
  78. background-color: #f6f8fa;
  79. color: #393a34;
  80. }
  81. #table_of_contents ul {
  82. list-style-type: none;
  83. padding-left: 1.5em;
  84. }
  85. #table_of_contents li {
  86. font-size: 0.9em;
  87. }
  88. #table_of_contents li a {
  89. color: #000000;
  90. }
  91. header.title {
  92. border-bottom: solid 1px #e1e4e8;
  93. }
  94. header.title > h1 {
  95. margin-bottom: 0.25em;
  96. }
  97. header.title > .description {
  98. display: block;
  99. margin-bottom: 0.5em;
  100. line-height: 1;
  101. }
  102. footer#edit {
  103. border-top: solid 1px #e1e4e8;
  104. margin: 3em 0 4em 0;
  105. padding-top: 2em;
  106. }
  107. </style>
  108. </head>
  109. <body>
  110. <div id="banner">
  111. <div id="rainbar"></div>
  112. <div id="logobar">
  113. <svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700">
  114. <polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon>
  115. <polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon>
  116. </svg>
  117. <div class="title">
  118. npm command-line interface
  119. </div>
  120. </div>
  121. </div>
  122. <section id="content">
  123. <header class="title">
  124. <h1 id="npm-unpublish">npm-unpublish</h1>
  125. <span class="description">Remove a package from the registry</span>
  126. </header>
  127. <section id="table_of_contents">
  128. <h2 id="table-of-contents">Table of contents</h2>
  129. <div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><ul><li><a href="#unpublishing-a-single-version-of-a-package">Unpublishing a single version of a package</a></li><li><a href="#unpublishing-an-entire-package">Unpublishing an entire package</a></li></ul><li><a href="#warning">Warning</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#force"><code>force</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
  130. </section>
  131. <div id="_content"><h3 id="synopsis">Synopsis</h3>
  132. <p>To learn more about how the npm registry treats unpublish, see our <!-- raw HTML omitted --> unpublish policies<!-- raw HTML omitted --></p>
  133. <h4 id="unpublishing-a-single-version-of-a-package">Unpublishing a single version of a package</h4>
  134. <pre lang="bash"><code>npm unpublish [&lt;@scope&gt;/]&lt;pkg&gt;@&lt;version&gt;
  135. </code></pre>
  136. <h4 id="unpublishing-an-entire-package">Unpublishing an entire package</h4>
  137. <pre lang="bash"><code>npm unpublish [&lt;@scope&gt;/]&lt;pkg&gt; --force
  138. </code></pre>
  139. <h3 id="warning">Warning</h3>
  140. <p>Consider using the <a href="../commands/npm-deprecate.html"><code>deprecate</code></a> command instead,
  141. if your intent is to encourage users to upgrade, or if you no longer
  142. want to maintain a package.</p>
  143. <h3 id="description">Description</h3>
  144. <p>This removes a package version from the registry, deleting its entry and
  145. removing the tarball.</p>
  146. <p>The npm registry will return an error if you are not <a href="../commands/npm-adduser.html">logged
  147. in</a>.</p>
  148. <p>If you do not specify a version or if you remove all of a package’s
  149. versions then the registry will remove the root package entry entirely.</p>
  150. <p>Even if you unpublish a package version, that specific name and version
  151. combination can never be reused. In order to publish the package again,
  152. you must use a new version number. If you unpublish the entire package,
  153. you may not publish any new versions of that package until 24 hours have
  154. passed.</p>
  155. <h3 id="configuration">Configuration</h3>
  156. <!-- raw HTML omitted -->
  157. <!-- raw HTML omitted -->
  158. <!-- raw HTML omitted -->
  159. <h4 id="dry-run"><code>dry-run</code></h4>
  160. <ul>
  161. <li>Default: false</li>
  162. <li>Type: Boolean</li>
  163. </ul>
  164. <p>Indicates that you don’t want npm to make any changes and that it should
  165. only report what it would have done. This can be passed into any of the
  166. commands that modify your local installation, eg, <code>install</code>, <code>update</code>,
  167. <code>dedupe</code>, <code>uninstall</code>, as well as <code>pack</code> and <code>publish</code>.</p>
  168. <p>Note: This is NOT honored by other network related commands, eg <code>dist-tags</code>,
  169. <code>owner</code>, etc.</p>
  170. <!-- raw HTML omitted -->
  171. <!-- raw HTML omitted -->
  172. <h4 id="force"><code>force</code></h4>
  173. <ul>
  174. <li>Default: false</li>
  175. <li>Type: Boolean</li>
  176. </ul>
  177. <p>Removes various protections against unfortunate side effects, common
  178. mistakes, unnecessary performance degradation, and malicious input.</p>
  179. <ul>
  180. <li>Allow clobbering non-npm files in global installs.</li>
  181. <li>Allow the <code>npm version</code> command to work on an unclean git repository.</li>
  182. <li>Allow deleting the cache folder with <code>npm cache clean</code>.</li>
  183. <li>Allow installing packages that have an <code>engines</code> declaration requiring a
  184. different version of npm.</li>
  185. <li>Allow installing packages that have an <code>engines</code> declaration requiring a
  186. different version of <code>node</code>, even if <code>--engine-strict</code> is enabled.</li>
  187. <li>Allow <code>npm audit fix</code> to install modules outside your stated dependency
  188. range (including SemVer-major changes).</li>
  189. <li>Allow unpublishing all versions of a published package.</li>
  190. <li>Allow conflicting peerDependencies to be installed in the root project.</li>
  191. <li>Implicitly set <code>--yes</code> during <code>npm init</code>.</li>
  192. <li>Allow clobbering existing values in <code>npm pkg</code></li>
  193. </ul>
  194. <p>If you don’t have a clear idea of what you want to do, it is strongly
  195. recommended that you do not use this option!</p>
  196. <!-- raw HTML omitted -->
  197. <!-- raw HTML omitted -->
  198. <h4 id="workspace"><code>workspace</code></h4>
  199. <ul>
  200. <li>Default:</li>
  201. <li>Type: String (can be set multiple times)</li>
  202. </ul>
  203. <p>Enable running a command in the context of the configured workspaces of the
  204. current project while filtering by running only the workspaces defined by
  205. this configuration option.</p>
  206. <p>Valid values for the <code>workspace</code> config are either:</p>
  207. <ul>
  208. <li>Workspace names</li>
  209. <li>Path to a workspace directory</li>
  210. <li>Path to a parent workspace directory (will result in selecting all
  211. workspaces within that folder)</li>
  212. </ul>
  213. <p>When set for the <code>npm init</code> command, this may be set to the folder of a
  214. workspace which does not yet exist, to create the folder and set it up as a
  215. brand new workspace within the project.</p>
  216. <p>This value is not exported to the environment for child processes.</p>
  217. <!-- raw HTML omitted -->
  218. <!-- raw HTML omitted -->
  219. <h4 id="workspaces"><code>workspaces</code></h4>
  220. <ul>
  221. <li>Default: null</li>
  222. <li>Type: null or Boolean</li>
  223. </ul>
  224. <p>Set to true to run the command in the context of <strong>all</strong> configured
  225. workspaces.</p>
  226. <p>Explicitly setting this to false will cause commands like <code>install</code> to
  227. ignore workspaces altogether. When not set explicitly:</p>
  228. <ul>
  229. <li>Commands that operate on the <code>node_modules</code> tree (install, update, etc.)
  230. will link workspaces into the <code>node_modules</code> folder. - Commands that do
  231. other things (test, exec, publish, etc.) will operate on the root project,
  232. <em>unless</em> one or more workspaces are specified in the <code>workspace</code> config.</li>
  233. </ul>
  234. <p>This value is not exported to the environment for child processes.</p>
  235. <!-- raw HTML omitted -->
  236. <!-- raw HTML omitted -->
  237. <!-- raw HTML omitted -->
  238. <h3 id="see-also">See Also</h3>
  239. <ul>
  240. <li><a href="../commands/npm-deprecate.html">npm deprecate</a></li>
  241. <li><a href="../commands/npm-publish.html">npm publish</a></li>
  242. <li><a href="../using-npm/registry.html">npm registry</a></li>
  243. <li><a href="../commands/npm-adduser.html">npm adduser</a></li>
  244. <li><a href="../commands/npm-owner.html">npm owner</a></li>
  245. <li><a href="../commands/npm-adduser.html">npm login</a></li>
  246. </ul>
  247. </div>
  248. <footer id="edit">
  249. <a href="https://github.com/npm/cli/edit/latest/docs/content/commands/npm-unpublish.md">
  250. <svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;">
  251. <path fill-rule="evenodd" d="M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.25.25 0 00-.064.108l-.558 1.953 1.953-.558a.249.249 0 00.108-.064l6.286-6.286z"></path>
  252. </svg>
  253. Edit this page on GitHub
  254. </a>
  255. </footer>
  256. </section>
  257. </body></html>