Search code examples
node.jsnpmnode-modulespnpm

Is there a way to remove all node_modules on a system and replace them with pnpm cache?


So node_modules have taken all the space on my drive now. What I want to achieve is delete all node_modules on my system and replace them what pnpm does i.e. a single cache for those dependencies?


Solution

  • For removing node_modules you can you this tool called npkill. Then when you'll work on some project, just run pnpm install. pnpm does not have a feature to scan all directories in search of node_modules, remove and reinstall them automatically.