Skip to content

Commit 957fa60

Browse files
Nathan Fritzwraithgar
authored andcommitted
docs: clarify uninstall lifecycle script
PR-URL: #3681 Credit: @fritzy Close: #3681 Reviewed-by: @wraithgar
1 parent 52401fd commit 957fa60

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/content/using-npm/scripts.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,19 @@ will default the `start` command to `node server.js`. `prestart` and
203203
* `test`
204204
* `posttest`
205205

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.
206219

207220
### User
208221

0 commit comments

Comments
 (0)