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: deps/npm/docs/content/using-npm/scripts.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -203,6 +203,19 @@ will default the `start` command to `node server.js`. `prestart` and
203
203
*`test`
204
204
*`posttest`
205
205
206
+
#### A Note on a lack of [`npm uninstall`](/commands/npm-uninstall) scripts
207
+
208
+
While npm v6 had `uninstall` lifecycle scripts, npm v7 does not. Removal of a package can happen for a wide variety of reasons, and there's no clear way to currently give the script enough context to be useful.
209
+
210
+
Reasons for a package removal include:
211
+
212
+
* a user directly uninstalled this package
213
+
* a user uninstalled a dependant package and so this dependency is being uninstalled
214
+
* a user uninstalled a dependant package but another package also depends on this version
215
+
* this version has been merged as a duplicate with another version
216
+
* etc.
217
+
218
+
Due to the lack of necessary context, `uninstall` lifecycle scripts are not implemented and will not function.
<h4id="a-note-on-a-lack-of-npm-uninstall-scripts">A Note on a lack of <ahref="../commands/npm-uninstall.html"><code>npm uninstall</code></a> scripts</h4>
341
+
<p>While npm v6 had <code>uninstall</code> lifecycle scripts, npm v7 does not. Removal of a package can happen for a wide variety of reasons, and there’s no clear way to currently give the script enough context to be useful.</p>
342
+
<p>Reasons for a package removal include:</p>
343
+
<ul>
344
+
<li>a user directly uninstalled this package</li>
345
+
<li>a user uninstalled a dependant package and so this dependency is being uninstalled</li>
346
+
<li>a user uninstalled a dependant package but another package also depends on this version</li>
347
+
<li>this version has been merged as a duplicate with another version</li>
348
+
<li>etc.</li>
349
+
</ul>
350
+
<p>Due to the lack of necessary context, <code>uninstall</code> lifecycle scripts are not implemented and will not function.</p>
340
351
<h3id="user">User</h3>
341
352
<p>When npm is run as root, scripts are always run with the effective uid
Copy file name to clipboardExpand all lines: deps/npm/man/man7/scripts.7
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -290,6 +290,26 @@ will default the \fBstart\fP command to \fBnode server\.js\fP\|\. \fBprestart\f
290
290
\fBposttest\fP
291
291
292
292
.RE
293
+
.SS A Note on a lack of npm help \fBuninstall\fP scripts
294
+
.P
295
+
While npm v6 had \fBuninstall\fP lifecycle scripts, npm v7 does not\. Removal of a package can happen for a wide variety of reasons, and there's no clear way to currently give the script enough context to be useful\.
296
+
.P
297
+
Reasons for a package removal include:
298
+
.RS0
299
+
.IP\(bu2
300
+
a user directly uninstalled this package
301
+
.IP\(bu2
302
+
a user uninstalled a dependant package and so this dependency is being uninstalled
303
+
.IP\(bu2
304
+
a user uninstalled a dependant package but another package also depends on this version
305
+
.IP\(bu2
306
+
this version has been merged as a duplicate with another version
307
+
.IP\(bu2
308
+
etc\.
309
+
310
+
.RE
311
+
.P
312
+
Due to the lack of necessary context, \fBuninstall\fP lifecycle scripts are not implemented and will not function\.
293
313
.SS User
294
314
.P
295
315
When npm is run as root, scripts are always run with the effective uid
0 commit comments