For me npm has always been the worst dependency manager I've used.
What bugs me the the most is that it installs all packages to node_modules by default. It is possible to specify another location but then your application will probably break because it has to know where your node_modules directory is.
Then there's the whole non-determinism thing: https://docs.npmjs.com/how-npm-works/npm3-nondet
There are some issues with it, but think more about it's concepts. I agree at the very least that npm is better than pip, but I feel like pip is really outdated. I'm surprised so many people who are saying it's fine and that setup.py is fine... I think it's just they're more familiar with it.
Check out yarn as well, some of it's practices are really awesome - getting inspiration from bundler and cargo.
This is as someone who doesn't use either of these languages that much. Even composer is better than pip IMO.
Pip has the same kinds of issues with transitive dependencies, but way way way worse since it doesn't allow multiple versions. When you have lib A requiring C ("A -> C1") and "B -> C2", the version of C you get depends on which of A or B was installed first, because the second's requirements are flat-out ignored.
Probably like 90% of the python projects I've looked at have requirement-conflicts because pip doesn't even warn you about this.
That's interesting, because personally I always found the fact that npm installs to `node_modules` to be one of its best features. No need for RVM Gemsets or python Virtualenv; everything gets installed inside your project directory and just works.
Additionally, since each package gets its own `node_modules` directory, there's no need to worry about conflicting dependencies. Multiple versions of the same module can run in the same process with no interference.
Minus the horrific bloat and slow install processes, and when you add a shrinkwrap file (otherwise prod runs who-knows-what)[1]: yeah, npm is pretty fantastic. No conflicts ever, super simple, they did a lot right. Fits in perfectly with the low-developer-brain-cost JS ecosystem.
[1] this is quite a large number of cases, but they are significant drawbacks.