2019-11-05 14:55:08 -05:00
|
|
|
---
|
|
|
|
title: npm-unpublish
|
2020-11-01 07:54:36 +01:00
|
|
|
section: 1
|
2019-11-05 14:55:08 -05:00
|
|
|
description: Remove a package from the registry
|
|
|
|
---
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### Synopsis
|
|
|
|
|
2021-01-15 16:09:24 -05:00
|
|
|
To learn more about how the npm registry treats unpublish, see our <a
|
|
|
|
href="https://www.npmjs.com/policies/unpublish" target="_blank"
|
|
|
|
rel="noopener noreferrer"> unpublish policies</a>
|
|
|
|
|
2020-03-19 12:53:27 -04:00
|
|
|
#### Unpublishing a single version of a package
|
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
```bash
|
2020-03-19 12:53:27 -04:00
|
|
|
npm unpublish [<@scope>/]<pkg>@<version>
|
2019-11-05 14:55:08 -05:00
|
|
|
```
|
|
|
|
|
2020-03-19 12:53:27 -04:00
|
|
|
#### Unpublishing an entire package
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2020-03-19 12:53:27 -04:00
|
|
|
```bash
|
|
|
|
npm unpublish [<@scope>/]<pkg> --force
|
|
|
|
```
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2020-03-19 12:53:27 -04:00
|
|
|
### Warning
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2021-01-15 16:09:24 -05:00
|
|
|
Consider using the [`deprecate`](/commands/npm-deprecate) command instead,
|
|
|
|
if your intent is to encourage users to upgrade, or if you no longer
|
|
|
|
want to maintain a package.
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### Description
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2021-01-15 16:09:24 -05:00
|
|
|
This removes a package version from the registry, deleting its entry and
|
|
|
|
removing the tarball.
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2021-01-15 16:09:24 -05:00
|
|
|
The npm registry will return an error if you are not [logged
|
2021-05-10 17:31:02 -04:00
|
|
|
in](/commands/npm-adduser).
|
2014-03-19 09:25:40 -07:00
|
|
|
|
2021-01-15 16:09:24 -05:00
|
|
|
If you do not specify a version or if you remove all of a package's
|
|
|
|
versions then the registry will remove the root package entry entirely.
|
2017-04-12 21:47:49 -07:00
|
|
|
|
2021-01-15 16:09:24 -05:00
|
|
|
Even if you unpublish a package version, that specific name and version
|
|
|
|
combination can never be reused. In order to publish the package again,
|
|
|
|
you must use a new version number. If you unpublish the entire package,
|
2021-03-04 17:40:28 -05:00
|
|
|
you may not publish any new versions of that package until 24 hours have
|
2021-01-15 16:09:24 -05:00
|
|
|
passed.
|
2014-09-24 14:41:07 -07:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### See Also
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm deprecate](/commands/npm-deprecate)
|
|
|
|
* [npm publish](/commands/npm-publish)
|
2019-11-05 14:55:08 -05:00
|
|
|
* [npm registry](/using-npm/registry)
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm adduser](/commands/npm-adduser)
|
|
|
|
* [npm owner](/commands/npm-owner)
|
2021-05-10 17:31:02 -04:00
|
|
|
* [npm login](/commands/npm-adduser)
|