npm-uninstall.1 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. .TH "NPM\-UNINSTALL" "1" "October 2021" "" ""
  2. .SH "NAME"
  3. \fBnpm-uninstall\fR \- Remove a package
  4. .SS Synopsis
  5. .P
  6. .RS 2
  7. .nf
  8. npm uninstall [<@scope>/]<pkg>[@<version>]\.\.\. [\-S|\-\-save|\-\-no\-save]
  9. aliases: remove, rm, r, un, unlink
  10. .fi
  11. .RE
  12. .SS Description
  13. .P
  14. This uninstalls a package, completely removing everything npm installed
  15. on its behalf\.
  16. .P
  17. It also removes the package from the \fBdependencies\fP, \fBdevDependencies\fP,
  18. \fBoptionalDependencies\fP, and \fBpeerDependencies\fP objects in your
  19. \fBpackage\.json\fP\|\.
  20. .P
  21. Futher, if you have an \fBnpm\-shrinkwrap\.json\fP or \fBpackage\-lock\.json\fP, npm
  22. will update those files as well\.
  23. .P
  24. \fB\-\-no\-save\fP will tell npm not to remove the package from your
  25. \fBpackage\.json\fP, \fBnpm\-shrinkwrap\.json\fP, or \fBpackage\-lock\.json\fP files\.
  26. .P
  27. \fB\-\-save\fP or \fB\-S\fP will tell npm to remove the package from your
  28. \fBpackage\.json\fP, \fBnpm\-shrinkwrap\.json\fP, and \fBpackage\-lock\.json\fP files\.
  29. This is the default, but you may need to use this if you have for
  30. instance \fBsave=false\fP in your \fBnpmrc\fP file
  31. .P
  32. In global mode (ie, with \fB\-g\fP or \fB\-\-global\fP appended to the command),
  33. it uninstalls the current package context as a global package\.
  34. \fB\-\-no\-save\fP is ignored in this case\.
  35. .P
  36. Scope is optional and follows the usual rules for npm help \fBscope\fP\|\.
  37. .SS Examples
  38. .P
  39. .RS 2
  40. .nf
  41. npm uninstall sax
  42. .fi
  43. .RE
  44. .P
  45. \fBsax\fP will no longer be in your \fBpackage\.json\fP, \fBnpm\-shrinkwrap\.json\fP, or
  46. \fBpackage\-lock\.json\fP files\.
  47. .P
  48. .RS 2
  49. .nf
  50. npm uninstall lodash \-\-no\-save
  51. .fi
  52. .RE
  53. .P
  54. \fBlodash\fP will not be removed from your \fBpackage\.json\fP,
  55. \fBnpm\-shrinkwrap\.json\fP, or \fBpackage\-lock\.json\fP files\.
  56. .SS Configuration
  57. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS START \-\->
  58. <!\-\- automatically generated, do not edit manually \-\->
  59. <!\-\- see lib/utils/config/definitions\.js \-\->
  60. .SS \fBsave\fP
  61. .RS 0
  62. .IP \(bu 2
  63. Default: true
  64. .IP \(bu 2
  65. Type: Boolean
  66. .RE
  67. .P
  68. Save installed packages to a package\.json file as dependencies\.
  69. .P
  70. When used with the \fBnpm rm\fP command, removes the dependency from
  71. package\.json\.
  72. <!\-\- automatically generated, do not edit manually \-\->
  73. <!\-\- see lib/utils/config/definitions\.js \-\->
  74. .SS \fBworkspace\fP
  75. .RS 0
  76. .IP \(bu 2
  77. Default:
  78. .IP \(bu 2
  79. Type: String (can be set multiple times)
  80. .RE
  81. .P
  82. Enable running a command in the context of the configured workspaces of the
  83. current project while filtering by running only the workspaces defined by
  84. this configuration option\.
  85. .P
  86. Valid values for the \fBworkspace\fP config are either:
  87. .RS 0
  88. .IP \(bu 2
  89. Workspace names
  90. .IP \(bu 2
  91. Path to a workspace directory
  92. .IP \(bu 2
  93. Path to a parent workspace directory (will result in selecting all
  94. workspaces within that folder)
  95. .RE
  96. .P
  97. When set for the \fBnpm init\fP command, this may be set to the folder of a
  98. workspace which does not yet exist, to create the folder and set it up as a
  99. brand new workspace within the project\.
  100. .P
  101. This value is not exported to the environment for child processes\.
  102. <!\-\- automatically generated, do not edit manually \-\->
  103. <!\-\- see lib/utils/config/definitions\.js \-\->
  104. .SS \fBworkspaces\fP
  105. .RS 0
  106. .IP \(bu 2
  107. Default: null
  108. .IP \(bu 2
  109. Type: null or Boolean
  110. .RE
  111. .P
  112. Set to true to run the command in the context of \fBall\fR configured
  113. workspaces\.
  114. .P
  115. Explicitly setting this to false will cause commands like \fBinstall\fP to
  116. ignore workspaces altogether\. When not set explicitly:
  117. .RS 0
  118. .IP \(bu 2
  119. Commands that operate on the \fBnode_modules\fP tree (install, update, etc\.)
  120. will link workspaces into the \fBnode_modules\fP folder\. \- Commands that do
  121. other things (test, exec, publish, etc\.) will operate on the root project,
  122. \fIunless\fR one or more workspaces are specified in the \fBworkspace\fP config\.
  123. .RE
  124. .P
  125. This value is not exported to the environment for child processes\.
  126. <!\-\- automatically generated, do not edit manually \-\->
  127. <!\-\- see lib/utils/config/definitions\.js \-\->
  128. .SS \fBinclude\-workspace\-root\fP
  129. .RS 0
  130. .IP \(bu 2
  131. Default: false
  132. .IP \(bu 2
  133. Type: Boolean
  134. .RE
  135. .P
  136. Include the workspace root when workspaces are enabled for a command\.
  137. .P
  138. When false, specifying individual workspaces via the \fBworkspace\fP config, or
  139. all workspaces via the \fBworkspaces\fP flag, will cause npm to operate only on
  140. the specified workspaces, and not on the root project\.
  141. <!\-\- automatically generated, do not edit manually \-\->
  142. <!\-\- see lib/utils/config/definitions\.js \-\->
  143. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS END \-\->
  144. .SS See Also
  145. .RS 0
  146. .IP \(bu 2
  147. npm help prune
  148. .IP \(bu 2
  149. npm help install
  150. .IP \(bu 2
  151. npm help folders
  152. .IP \(bu 2
  153. npm help config
  154. .IP \(bu 2
  155. npm help npmrc
  156. .RE