4

How to Delete Node Modules Folder With npkill

 2 years ago
source link: https://www.makeuseof.com/how-to-delete-unwanted-node-modules-folder-with-npkill/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How to Delete Node Modules Folder With npkill

By Nitin Ranganath

Published 9 hours ago

Don't let unused packages bog down your drives, get rid of them with npkill.

Node.js is a JavaScript runtime environment that allows you to run JavaScript outside web browsers, making it a popular choice for developing all kinds of applications. Part of its popularity is due to the plethora of NPM packages out there to ease the developer experience.

However, these packages can consume quite a lot of space on your disk, and you might not want to keep them around after completing the development process. Learn how to clean these unwanted packages from the node_modules folder with npkill.

What Is npkill and How Can You Use It?

npkill is a lightweight NPM package that allows you to easily find and remove old and heavy node_modules folders. Before you get started using npkill, make you have Node.js and NPM installed on your computer.

Related: How to Install Node.js and npm on Windows

Running npkill is a pretty straightforward process and does not require you to install any additional dependencies. You can access it by running this command in the terminal:

npx npkill

This command will scan for all the node_modules folders starting at the path where the command was executed and display them along with the amount of space they take up on your disk.

Running npkill on terminal

Using this interactive tool, you can pick the projects that you no longer actively develop and delete the dependency files and folders seamlessly, with just the press of a button.

You can use the arrow keys to move between the listed folders and the Space Bar to delete the selected folder. Once done, use the Q key or Ctrl + C keys to exit the interactive menu.

Stay Cautious While Deleting the Folders

npkill is a handy tool for deleting unwanted files of old projects that you no longer maintain. However, deleting the node_modules folder of active projects will require you to reinstall them before you can run the app again. It's recommended that you proceed with caution while deleting any folder as this action is irreversible.

New to the Node.js ecosystem or transitioning from a different technology? Here's everything you need to know to get started with Node.js development.

About The Author

607961b40c2b9-me.png?fit=crop&w=100&h=100

Nitin Ranganath (37 Articles Published)

Nitin is an avid software developer and a computer engineering student developing web applications using JavaScript technologies. He works as a freelance web developer and likes to write for Linux and Programming in his free time.

More From Nitin Ranganath

Subscribe to our newsletter

Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!

Click here to subscribe

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK