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