When I first started learning JavaScript, someone told me to run npm install. I did. My laptop fan turned on. A folder appeared called node_modules. It had 47,000 files in it. I had written 12 lines of code.
This is normal. This is JavaScript. Welcome.
What Is node_modules
node_modules is a folder that contains your dependencies, your dependencies' dependencies, and the dependencies of those dependencies going back approximately to the Big Bang. You installed one package. That package needed 300 other packages. Those packages each needed 200 more. It is fine. Everything is fine.
The .gitignore Situation
The first time I pushed a project to GitHub without a .gitignore, I uploaded node_modules to the internet. The push took 11 minutes. GitHub was not happy. I was not happy. We do not talk about it.
The Delete and Reinstall Ritual
Something broken? Delete node_modules. Run npm install again. Nobody knows why this works. It just does. This is ancient developer magic passed down through generations of Stack Overflow answers.
Pro Tips
1. Always add node_modules to .gitignore.
2. Never look inside node_modules. You are not ready.
3. If something breaks, delete it and reinstall.
4. If that does not work, delete everything and start over.
5. Consider therapy.