NPM-REMOVAL(7)
π NPM-REMOVAL β the manual page (section 7, bestie)
okay so this is the NPM-REMOVAL(7) page and it's basically the "how do I break up with npm" page. it's giving closure. it's giving moving on. let's get into it π«Ά
β¨ NAME β¨
Removal β cleaning the slate π§Ήβ¨
πΈ Synopsis πΈ
so sad to see you go π (genuinely, we'll miss you)
sudo npm uninstall npm -g
or, if that fails, please proceed to the more severe uninstalling methods π (yes, there are levels to this)
π More Severe Uninstalling π
usually, the above instructions are sufficient. that will remove npm, but leave behind anything you've installed. (iconic behaviour honestly β it dips but leaves its stuff everywhere π)
if that doesn't work, or if you require more drastic measures, continue reading. π
note: this is only necessary for globally-installed packages. local installs are completely contained within a project's node_modules folder. delete that folder, and everything is gone β unless a package's install script is particularly ill-behaved π (some of them are, no cap).
this assumes that you installed node and npm in the default place. if you configured node with a different --prefix, or installed npm with a different prefix setting, then adjust the paths accordingly, replacing /usr/local with your install prefix. (yes, literally go through and swap it β the vibes are customisable, the paths are not.)
to remove everything npm-related manually:
rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*
if you installed things with npm, then your best bet is to uninstall them with npm first, and then install them again once you have a proper install. this can help find any symlinks that are lying around π (sneaky little things):
ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm
prior to version 0.3, npm used shim files for executables and node modules. to track those down, you can do the following:
find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ;
that's the whole hunt πβ¨ good luck, you got this πͺ
π¦ See also π¦
npm help uninstallnpm help prune
and that's the page, bestie π this was NPM@12.2.1, living under the NPM-REMOVAL(7) section, and it's dated the same day as the rest of this little manual family π go forth and uninstall slayfully πβ¨
π¦ where this page comes from
- arch rolling: npm 12.2.1-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms