You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/cli-commands/npm-unpublish.md
+11-15Lines changed: 11 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -10,19 +10,21 @@ description: Remove a package from the registry
10
10
11
11
### Synopsis
12
12
13
+
#### Unpublishing a single version of a package
14
+
13
15
```bash
14
-
npm unpublish [<@scope>/]<pkg>[@<version>]
16
+
npm unpublish [<@scope>/]<pkg>@<version>
15
17
```
16
18
17
-
###Warning
19
+
#### Unpublishing an entire package
18
20
19
-
**It is generally considered bad behavior to remove versions of a library
20
-
that others are depending on!**
21
+
```bash
22
+
npm unpublish [<@scope>/]<pkg> --force
23
+
```
21
24
22
-
Consider using the `deprecate` command
23
-
instead, if your intent is to encourage users to upgrade.
25
+
### Warning
24
26
25
-
There is plenty of room on the registry.
27
+
Consider using the `deprecate` command instead, if your intent is to encourage users to upgrade, or if you no longer want to maintain a package.
26
28
27
29
### Description
28
30
@@ -34,16 +36,10 @@ the root package entry is removed from the registry entirely.
34
36
35
37
Even if a package version is unpublished, that specific name and
36
38
version combination can never be reused. In order to publish the
37
-
package again, a new version number must be used. Additionally,
38
-
new versions of packages with every version unpublished may not
39
-
be republished until 24 hours have passed.
39
+
package again, a new version number must be used. If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed.
40
40
41
-
With the default registry (`registry.npmjs.org`), unpublish is
42
-
only allowed with versions published in the last 72 hours. If you
43
-
are trying to unpublish a version published longer ago than that,
To learn more about how unpublish is treated on the npm registry, see our <ahref="https://www.npmjs.com/policies/unpublish"target="_blank"rel="noopener noreferrer"> unpublish policies</a>.
45
42
46
-
The scope is optional and follows the usual rules for [`scope`](/using-npm/scope).
0 commit comments