Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
npm-unpublish.md127 linesDownload Raw Back to commands
1---
2title: npm-unpublish
3section: 1
4description: Remove a package from the registry
5---
6
7### Synopsis
8
9```bash
10npm unpublish [<package-spec>]
11```
12
13To learn more about how the npm registry treats unpublish, see our [unpublish policies](https://docs.npmjs.com/policies/unpublish).
14
15### Warning
16
17Consider 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.
18
19### Description
20
21This removes a package version from the registry, deleting its entry and removing the tarball.
22
23The npm registry will return an error if you are not [logged in](/commands/npm-adduser).
24
25If you do not specify a package name at all, the name and version to be unpublished will be pulled from the project in the current directory.
26
27If you specify a package name but 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.
28
29Even if you unpublish a package version, that specific name and version combination can never be reused.
30In order to publish the package again, you must use a new version number.
31If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed.
32
33### Configuration
34
35#### `dry-run`
36
37* Default: false
38* Type: Boolean
39
40Indicates that you don't want npm to make any changes and that it should
41only report what it would have done. This can be passed into any of the
42commands that modify your local installation, eg, `install`, `update`,
43`dedupe`, `uninstall`, as well as `pack` and `publish`.
44
45Note: This is NOT honored by other network related commands, eg `dist-tags`,
46`owner`, etc.
47
48
49
50#### `force`
51
52* Default: false
53* Type: Boolean
54
55Removes various protections against unfortunate side effects, common
56mistakes, unnecessary performance degradation, and malicious input.
57
58* Allow clobbering non-npm files in global installs.
59* Allow the `npm version` command to work on an unclean git repository.
60* Allow deleting the cache folder with `npm cache clean`.
61* Allow installing packages that have an `engines` declaration requiring a
62  different version of npm.
63* Allow installing packages that have an `engines` declaration requiring a
64  different version of `node`, even if `--engine-strict` is enabled.
65* Allow `npm audit fix` to install modules outside your stated dependency
66  range (including SemVer-major changes).
67* Allow unpublishing all versions of a published package.
68* Allow conflicting peerDependencies to be installed in the root project.
69* Implicitly set `--yes` during `npm init`.
70* Allow clobbering existing values in `npm pkg`
71* Allow unpublishing of entire packages (not just a single version).
72
73If you don't have a clear idea of what you want to do, it is strongly
74recommended that you do not use this option!
75
76
77
78#### `workspace`
79
80* Default:
81* Type: String (can be set multiple times)
82
83Enable running a command in the context of the configured workspaces of the
84current project while filtering by running only the workspaces defined by
85this configuration option.
86
87Valid values for the `workspace` config are either:
88
89* Workspace names
90* Path to a workspace directory
91* Path to a parent workspace directory (will result in selecting all
92  workspaces within that folder)
93
94When set for the `npm init` command, this may be set to the folder of a
95workspace which does not yet exist, to create the folder and set it up as a
96brand new workspace within the project.
97
98This value is not exported to the environment for child processes.
99
100#### `workspaces`
101
102* Default: null
103* Type: null or Boolean
104
105Set to true to run the command in the context of **all** configured
106workspaces.
107
108Explicitly setting this to false will cause commands like `install` to
109ignore workspaces altogether. When not set explicitly:
110
111- Commands that operate on the `node_modules` tree (install, update, etc.)
112will link workspaces into the `node_modules` folder. - Commands that do
113other things (test, exec, publish, etc.) will operate on the root project,
114_unless_ one or more workspaces are specified in the `workspace` config.
115
116This value is not exported to the environment for child processes.
117
118### See Also
119
120* [package spec](/using-npm/package-spec)
121* [npm deprecate](/commands/npm-deprecate)
122* [npm publish](/commands/npm-publish)
123* [npm registry](/using-npm/registry)
124* [npm adduser](/commands/npm-adduser)
125* [npm owner](/commands/npm-owner)
126* [npm login](/commands/npm-adduser)
127 
codekingpro/portable-devtools · Team Ai