removal.7 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. .TH "REMOVAL" "7" "August 2021" "" ""
  2. .SH "NAME"
  3. \fBremoval\fR \- Cleaning the Slate
  4. .SS Synopsis
  5. .P
  6. So sad to see you go\.
  7. .P
  8. .RS 2
  9. .nf
  10. sudo npm uninstall npm \-g
  11. .fi
  12. .RE
  13. .P
  14. Or, if that fails, get the npm source code, and do:
  15. .P
  16. .RS 2
  17. .nf
  18. sudo make uninstall
  19. .fi
  20. .RE
  21. .SS More Severe Uninstalling
  22. .P
  23. Usually, the above instructions are sufficient\. That will remove
  24. npm, but leave behind anything you've installed\.
  25. .P
  26. If that doesn't work, or if you require more drastic measures,
  27. continue reading\.
  28. .P
  29. Note that this is only necessary for globally\-installed packages\. Local
  30. installs are completely contained within a project's \fBnode_modules\fP
  31. folder\. Delete that folder, and everything is gone less a package's
  32. install script is particularly ill\-behaved)\.
  33. .P
  34. This assumes that you installed node and npm in the default place\. If
  35. you configured node with a different \fB\-\-prefix\fP, or installed npm with a
  36. different prefix setting, then adjust the paths accordingly, replacing
  37. \fB/usr/local\fP with your install prefix\.
  38. .P
  39. To remove everything npm\-related manually:
  40. .P
  41. .RS 2
  42. .nf
  43. rm \-rf /usr/local/{lib/node{,/\.npm,_modules},bin,share/man}/npm*
  44. .fi
  45. .RE
  46. .P
  47. If you installed things \fIwith\fR npm, then your best bet is to uninstall
  48. them with npm first, and then install them again once you have a
  49. proper install\. This can help find any symlinks that are lying
  50. around:
  51. .P
  52. .RS 2
  53. .nf
  54. ls \-laF /usr/local/{lib/node{,/\.npm},bin,share/man} | grep npm
  55. .fi
  56. .RE
  57. .P
  58. Prior to version 0\.3, npm used shim files for executables and node
  59. modules\. To track those down, you can do the following:
  60. .P
  61. .RS 2
  62. .nf
  63. find /usr/local/{lib/node,bin} \-exec grep \-l npm \\{\\} \\; ;
  64. .fi
  65. .RE
  66. .P
  67. (This is also in the README file\.)
  68. .SS See also
  69. .RS 0
  70. .IP \(bu 2
  71. npm help uninstall
  72. .IP \(bu 2
  73. npm help prune
  74. .RE