Sara Chipps started this awesome thread about bundler vs. npm. You should check it out cause it's highly entertaining. https://twitter.com/SaraJChipps/status/484727602049859584
But I do want to get more info on the workflow problems people experience with npm. It has always been the simplest thing to me. But I'm also fully aware that perceptions are relative. Most ruby folks are totally fine with bundler even though it gives me constant headaches. But the bundler issues are well documented. This seems to be less true for npm. I want to gather some info about people's experiences. I promise I'll try to refrain from the canned "you're doing it wrong" response.
Also, we've already established that npm is network hungry and could do a better job of maintaining an offline cache. https://twitter.com/ag_dubs/status/484733343108706305 Nobody's arguing that. But I'm less concerned about feature requests here. I'm interested in where npm breaks for you.
Here's Ryan Florence. https://twitter.com/ryanflorence/status/484730296156176385
`rm -rf node_modules && npm cache clean && npm install && npm dedupe` feels almost as reassuring as just `bundle install`
I want to hear about the step before this where something's wrong and a simple npm install
doesn't fix it. Messing around with the cache suggests there's something very strange in people's workflows. And messing around with dedupe suggests that the dependency tree that people are trying to achieve is very different from mine. Trashing your whole node_modules folder shouldn't be required. But it's usually an easier step than trying to debug whatever weird state you got yourself into. I believe this is because npm installs don't usually fail and you can just refresh your whole dep tree fairly easily (network permitting).
But these are just my own perceptions. So lets hear it. Why do you hate npm?
I haven't yet found an actual error that needed
npm cache clean
that wasn't "I switched registries and one was horribly broken".remove-and-start-over sounds like a feature if you want it --
npm ls
andnpm outdated
should be ways to be more fine-grained about it. It shouldn't be normal workflow, though.npm dedupe
sounds cargo-culted to me. I believe that a freshnpm install
should yield no changes in that case.The only things I ever do are
rm -rf node_modules; npm install
andnpm install
.Now caching could be vastly improved, and I believe is THE hotbutton item holding up further client development -- what's there is entangled, ugly, and frustrating.
As a counterpoint to bundler being well documented, I feel like it's two hours of voodoo to make it work every time, and I don't know what makes it go. I feel like I'm missing something foundational that if it was just explained, I might not hate it. Haven't found it in any docs, though. I dread every new ruby app I have to mess with.