How to clean npm junk from disk (node_modules, nvm, npm)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Ported from this article
WARNING: All processes are irreversible!
Delete all unused global node modules and Node.js executables installed with nvm
Running nvm ls will show you all versions installed, you can use nvm uninstall v12.2.0 for example to uninstall a specific version, however this doesn’t remove global npm packages that you installed for this version. It’s better to go to ~/.nvm/versions/node folder and rm -rf versions that you don’t need.
A useful command to delete all versions that you aren’t currently using:
Delete all node_modules folders from your projects
Check size of node_modules in folder with your projects
Delete all node_modules folders
Mac / Linux
Windows
Yarn and npm cache
Xcode
Really nice tool for deleting old simulators, archives and other Xcode junk: https://apps.apple.com/us/app/devcleaner-for-xcode/id1388020431?mt=12
Homebrew
Homebrew periodacaly performs cleanup but if you need some extra space now, you can run:
Docker
Docker needs to be running for this to work. Be aware that docker removes all images that currently aren’t used, so if you want to keep something, start it and it won’t be deleted. Check docs for more info.
add ‘—volumes’ to delete all volumes as well
If you have some lang/tool/ide that requires cleanup leave a comment and I will add it.