Fixing an Issue with Installing npm Packages

Are you encountering an issue when installing npm packages? Don’t worry, you’re not alone. This problem can occur due to the behavior of npm when installing a package in an empty folder. In this blog, we’ll discuss the issue and provide solutions to fix it. When using the command npm install <packagename> in an empty folder, npm creates a package.json file with the package as a dependency, a package-lock.json file, and installs the package in the node_modules folder....

How to Remove All the node_modules Folders Content

Save Disk Space by Deleting Unnecessary node_modules Folders Recently, I needed to transfer a folder filled with old projects to a new computer. When I tried compressing it, I was surprised to find that its size was a whopping 8GB. Quite excessive for simple coding projects that mainly consist of text files. Since all the projects were written in JavaScript, each one had a node_modules folder. However, these folders are completely unnecessary because they can be regeneratd by running npm install within each project....

The node_modules folder size: A Privilege, Not a Problem

My thoughts on the node_modules folder size debate In the world of JavaScript application development, the size of the node_modules folder has always been a topic of discussion. How can a simple application be 100, 200MB in size without even adding a single line of code? Take, for example, running npx create-react-app todolist, which downloads a whopping 218.7MB of “stuff”! (Yes, that’s the actual number). However, before we criticize the size of the node_modules folder, let’s think about the countless hours that programmers all over the world have put into creating and maintaining open-source software....