NPM-REMOVAL(7)

πŸ“¦
version 12.2.1 Β· 2 versions
, in arch rolling

πŸ’… 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 uninstall
  • npm 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