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