6 ms·
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
by LukaD 10y ago
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 https://docs.npmjs.com/how-npm-works/npm3-nondet
Also check out https://github.com/npm/npm/issues/10999 https://github.com/npm/npm/issues/10999
This is just insane!
- Groxx 10y agoPip 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.
- derimagia 10y agoThere 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.
- Ajedi32 10y agoThat'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.