DEV Community

Discussion on: When npm tells you you're hosed

Collapse
 
worc profile image
worc • Edited

oof, magic thinking and cargo cult dependency management. there's always a stack trace somewhere that will point out what went wrong, and it's helpful to at least look at that. you might still need a full reinstall to untangle the dependency tree, but at least you'll know what caused it in the first place.

and if it happens more than once or starts becoming a consistent problem, you know where to start digging.

Collapse
 
john_papa profile image
John Papa

I Have looked. often the error varies and even more often it’s due to missing files in multiple packages. I’ve found it more effective and efficient to wipe and install. Saves time and allows me to keep moving forward.

But of course your mileage may vary.

Collapse
 
worc profile image
worc

which sounds specific to your situation on a bad internet connection and not a great bit of advice to just push as a general solution. of your four points, i feel like only number 2 is a legit excuse to nuke node_modules so regularly.

Thread Thread
 
john_papa profile image
John Papa

Yes, you are spot on that it is based on my experience. I've experienced this in support of 1000+ devs and I agree that's still a small sample size of the overall npm population.