NPM-REMOVAL(1)
π
NPM-REMOVAL(1) β the npm-removal page, bestie edition
okay so today we're learning how to say goodbye π and honestly? it's giving breakup energy. this is the npm-removal man page, and yes it really is called "Cleaning the Slate" β¨
πΈ NAME πΈ
npm-removal β Cleaning the Slate π§Ήπ
π¦ SYNOPSIS π¦
So sad to see you go. π
sudo npm uninstall npm -g
Or, if that fails, get the npm source code, and do:
sudo make uninstall
π₯ More Severe Uninstalling π₯
Usually, the above instructions are sufficient. That will remove npm, but leave behind anything you've installed. ngl that's kind of the vibe β npm dips, your stuff stays π«Ά
If that doesn't work, or if you require more drastic measures, continue reading. π this is the escalation arc, main character energy only.
Note that 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). π like, unless, okay, some packages are feral.
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. β literally just swap the path, iykyk.
To remove everything npm-related manually:
rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*
β οΈ that's an rm -rf bestie. read it twice. then read it again. π
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:
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 \{\} \; ;
(This is also in the README file.) π
π SEE ALSO π
- README
npm help uninstallnpm help prune
and that's the whole thing, periodt π this has been NPM-REMOVAL(1) from March 2017 β yep, the page and the date both stamped NPM-REMOVAL(1), slay π go forth and uninstall responsibly, ily, bye π¦β¨
π¦ where this page comes from
- nixos 26.05: hueadm 1.2.1
- nixpkgs unstable: hueadm 1.2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms