As frontend developers, we usually treat node_modules as this huge magical black-box where you sacrifice mega or gigabytes of your hard disk space in the hope of getting more productive by adding random people code to yours until it work. Crazy but it actually works… until it doesn’t!

This is a story about how I managed to get in and out of node_modules in one piece.

Just another normal working day, working on a bunch of features and issues and trying to be as productive as possible.

Ticket done, what’s next? Oh nice, an easy one: security guys are not happy that yarn audit is failing. Time for some upgrades, yay!

I don’t know about you, but I learn by doing. If you are like me then I have good news for you: you can follow this journey on your own machine.

I tried to reproduce the issue using as little code as possible to mimic our complex real-world micro-frontend-ish monorepo situation where I had this problem. Unless you already tried all of the techniques I mentioned I strongly recommend to clone this repo and follow step by step: clone this repo, open it on vscode and let’s go. I will be waiting right here…

note: I assume you use vscode, but it’s not a requirement. Who am I to start an editor war!

#javascript #react

Journey to The Center Of Node_modules
1.35 GEEK