Singles

My Kid Deleted My node_modules and I Almost Cried

A three-year-old's keyboard adventure taught me everything about resilience, backups, and what really matters

4 min read
August 7, 2024
parenting, disasters, lessons-learned, resilience

My Kid Deleted My node_modules and I Almost Cried

Singles (45s): Sometimes the best debugging lessons come from tiny fingers on keyboards

The Setup

It was Tuesday morning, 10:47 AM. I had finally—FINALLY—gotten my development environment set up perfectly on my new laptop. You know the drill: spend three days configuring everything, installing the exact Node version, getting all the environment variables just right, and wrestling with that one dependency that always breaks on fresh installs.

I was in the zone. Coffee was hot, baby was napping, toddler was "helping" by playing educational games on her tablet right next to my desk. The deploy was running smoothly for the first time in weeks.

Then I heard it.

The rapid-fire clicking of keyboard keys. Not my keyboard keys.

The Moment

I turned to see my three-year-old, Mia, standing on her tip-toes reaching over my laptop keyboard, systematically pressing every single key she could reach. Her tablet had died, and she'd apparently decided mine looked more interesting.

"Look, Daddy! I'm coding like you!"

My heart stopped when I saw my terminal window. Somehow, in the span of maybe fifteen seconds, she had managed to:

  1. Navigate to my project directory (how??)
  2. Type what looked like rm -rf node_modules (IMPOSSIBLE)
  3. Hit enter

The terminal was cheerfully running the deletion command.

💯

Keeping It Real

👨‍👧‍👦 Every SAHD can relate

I watched 847 MB of carefully curated dependencies disappear, one package at a time. My React project. My Next.js build tools. The TypeScript definitions that took forever to install correctly.

"Did I do good coding, Daddy?"

I looked at her proud little face, then at my terminal showing "removing node_modules/react", then back at her face.

This was my Sophie's Choice moment: Do I explain to a three-year-old that she just destroyed two hours of work, or do I smile and say "Great job, buddy!"?

The Lesson

Here's what I learned in that moment of watching my node_modules disappear: it was just files.

Not just in the philosophical sense—though there's that too—but in the practical, SAHD-developer sense. Those weren't MY files. They were npm's files. I could get them back with a single command: npm install.

But more importantly, I realized I was treating my development environment like it was precious and fragile, instead of treating it like what it actually is: a tool that should be robust enough to handle the chaos of SAHD life.

The Bigger Picture

This tiny disaster taught me three things that changed how I work:

1. Infrastructure Should Be Resilient

Before the Great node_modules Deletion of 2024, I was that developer who spent hours crafting the perfect development setup, then treated it like a house of cards that would collapse if I breathed on it wrong.

After? I started building for chaos:

  • Docker containers for consistent environments
  • Scripts for everything: npm run setup should rebuild my entire dev environment
  • Dotfiles in git: My configurations live in version control, not just on my laptop
  • Cloud development: CodeSpaces, Gitpod, Replit for when local breaks

If my three-year-old can destroy my setup in 15 seconds, so can a system update, a power outage, or a coffee spill.

2. The Real Work Isn't in node_modules

I was mourning the loss of dependencies, but you know what survived? My actual code. My components. My business logic. The stuff I actually wrote.

node_modules is just the scaffolding. The real building—my building—was still there.

This reframed how I think about everything:

  • My code is precious and goes in git with obsessive commits
  • Generated files are replaceable and get gitignored
  • Dependencies are temporary roommates, not family heirlooms
  • Configuration that matters gets documented and versioned

3. Teaching Moments Beat Perfect Workflows

I could have been frustrated with Mia for "ruining" my work. Instead, I sat her on my lap and we ran npm install together.

"Watch, sweetie. The computer is downloading all the tools Daddy needs to make websites."

She was fascinated by the progress bars, the package names flying by, the way the terminal looked like "real programming." When it finished, she clapped.

"We fixed it, Daddy!"

And we did. Together.

What I'd Do Differently

Looking back, there are some practical things I should have done:

Technical Prevention

  • Physical barriers: My laptop now lives on a standing desk she can't reach
  • Auto-save everything: My editor saves on focus change, not just Cmd+S
  • Faster setup scripts: npm run dev now handles missing dependencies automatically
  • Background backups: Time Machine runs every hour, not daily

Parenting Integration

  • Kid-friendly workspace: She has her own "coding setup" with an old keyboard
  • Collaborative coding time: We build simple websites together now
  • Clear boundaries: "Daddy's work computer" vs "family tablet" are distinct concepts
  • Positive reinforcement: Her interest in "helping" is actually wonderful

But honestly? I'm glad it happened exactly the way it did.

For Fellow SAHDs

If you're reading this while your own tiny human is eyeing your keyboard, here's what I want you to know:

Your setup will break. Not if, when. And it probably won't be your fault.

Plan for chaos:

  • Make setup reproducible with one command
  • Keep your actual work in git with frequent commits
  • Use cloud development environments for important projects
  • Build physical and digital barriers between tiny fingers and critical systems

But also remember that the interruptions and "disasters" are often the best parts of this gig. My daughter doesn't remember the bug I was fixing that day. But she definitely remembers the day we "fixed the computer together."

Can You Relate?

What's the worst thing your kids have done to your development setup? Share your horror stories (and how you recovered) in the comments!

The Takeaway

Six months later, Mia still asks if she can "help with coding." Now I have a plan for that: we open up Scratch Jr. on her tablet, and she makes animated stories while I work on the laptop.

She's building logic, loops, and sequences. I'm building websites and web apps. We're both coding, just at different levels.

And my node_modules? It gets deleted and reinstalled probably twice a week now, because I'm no longer afraid of it. My development environment is robust, my work is saved, and my backup plans have backup plans.

Sometimes the best lessons come from the worst disasters. And sometimes the worst disasters are just tiny fingers discovering the delete key.

The moral of the story: Build systems that can survive toddlers. If it can handle a three-year-old, it can handle anything production throws at it.

More from SAHD.dev

Dive deeper with our Extended Play tutorials, or explore the Toolbox.