How to Delete Node Modules Folder With npkill
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.
How to Delete Node Modules Folder With npkill
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.
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
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.
Subscribe to our newsletter
Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!
Recommend
-
9
题目¶ 原题地址:https://leetcode.com/problems/delete-node-in-a-bst/...
-
2
In this series of posts, I will discuss coding questions on the LinkedList Data structure. The posts in this series will be organized in the following way, Question Link ❓ Possible Explanation 📝
-
7
In this series of posts, I will discuss coding questions on the LinkedList Data structure. The posts in this series will be organized in the following way, Question Link ❓ Possible Explanation 📝
-
7
How would you write a function to delete a node in the middle of a singly linked list? Assume that the only thing you get access to in the function is the node that needs to be deleted. We also want to reconstruct the linked list so that a...
-
6
Do you have a problem when you can’t delete a folder or several files from your PC or laptop? Does Windows show you an “access denied” error? It can happen due to various causes when you delete, edit or overwrite files. Read this article to f...
-
8
-
14
Delete folder - delete files in folder - J2ME advertisements I am trying to clear all the files in a folder usi...
-
9
Not FoundYou just hit a route that doesn't exist... the sadness.LoginRadius empowers businesses to deliver a delightful customer experience and win customer trust. Using the LoginRadius Identity...
-
3
Intro In this article I'll tell you about a cool tool I just found on npm, called npkill, that helps you cleaning node_modules from projects you no longer user but still want to keep.
-
2
Easily find and remove old and heavy node_modules folders
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK