Blogs
...les_with_npkill.md
Clean Node Modules directory with NPKILL

Well, no secret that modern web development heavily rely on NPM package that saved on node_modules forlder. To clean up unused dependency, you can use npkill, first install it globally:

bash
npm i -g npkill

Then, run on your root directory.

bash
npkill
-----                    __   .__.__  .__
-           ____ ______ |  | _|__|  | |  |
------     /    \\____ \|  |/ /  |  | |  |
----      |   |  \  |_> >    <|  |  |_|  |__      releasable space: 5.40 GB
--        |___|  /   __/|__|_ \__|____/____/      space saved: 0.00 GB
-------        \/|__|        \/       0.11.3      search completed 8.35s

 > CURSORS for select; SPACE to delete <                              last_mod   size
 /Users/john/code/app-project-one/node_modules                          20d  1234.5 MB
 /Users/john/code/app-project-two/node_modules                          0d  640.09 MB

Use up and down to move selector and use space button to clear the node modules folder. That's it!

Last update: 2024-03-07 11:20:08 UTC (9 months ago)