3 ms·
IMO, npm is a breeze compared to pip. With npm you know that `npm i && npm start` will start 95% of the projects cross-platform. It allows having different subd
by pmoleri 5y ago
IMO, npm is a breeze compared to pip. With npm you know that `npm i && npm start` will start 95% of the projects cross-platform. It allows having different subdependencies versions in a way that just works. It encourages semver but at the same time you have lock file. Is highly customizable with rc files.
Perhaps I just don't have that much experience with pip, but it feels more like a tool to install packages, then you're on your own with some makefile or python scripts with no standard setup.
- ezekg 5y agonpm is one of the only dependency managers I’ve seen that does more than install packages. Every other package manager: pip, bundler, composer, all do one thing and do it well. npm does everything but nothing well.
- pmoleri 5y agoWow, bold statement. Can you give examples of things it does wrong?
- danielheath 5y agoI can. In most ecosystems, I can share package sources between a VM and a host. npm shares mutable content (eg compiled artifacts) with package sources in `node_modules`. That breaks a ton of workflows that are common in other ecosystems. For instance, in ruby apps using bundler, I can commit my dependencies in vendor/cache; there are no network dependencies other than fetching the source code. That makes turning code into a running server faster and more reliable. Go supported the same thing from v1 via GOPATH (because that's how google runs their repo). Commit your dependencies and carry on (go had different shortcomings in dependency management in those days). This feature turns things like `left-pad` from a fiasco into a non-event. Also, it took npm years to implement a lockfile, only for most npm commands to disregard it. I used to frequently get versions other than the one I wanted. It's been ~6 years since I switched away so it may have improved since then. After my experience using npm I fundamentally do not trust the brand, and until yarn screws up I have no reason to give npm another chance.
- lhnz 5y agoThere's nothing stopping you from running `npm` or `yarn` offline and committing the cache. In fact, both of these package managers have had direct support for this workflow since 2016 (https://docs.npmjs.com/cli/v7/using-npm/config#offline https://docs.npmjs.com/cli/v7/using-npm/config#offline) and 2017 (https://classic.yarnpkg.com/blog/2016/11/24/offline-mirror/ https://classic.yarnpkg.com/blog/2016/11/24/offline-mirror/) respectively.
- rlkf 5y agoExcept that the format of the npm cache is version-specific. You would probably be better off using https://github.com/heikkipora/registry-sync https://github.com/heikkipora/registry-sync instead.
- rlkf 5y ago`npm uninstall foo` simultaneously upgrades all the _other_ packages. Experienced developers they are not.
- norman784 5y agoCargo from rust does more than npm and IMHO it does very well.