5 ms·
I’m glad that Yarn will continue. Npm has improved, but it’s still less pleasant to work with than yarn (which basically always does what I expect, not so for n
by Aeolun 8y ago
I’m glad that Yarn will continue. Npm has improved, but it’s still less pleasant to work with than yarn (which basically always does what I expect, not so for npm).
- h1d 8y agoWhich part of npm acts unexpectedly?
- coding123 8y agoWe switched around June last year to yarn because git URL dependencies on branches was broken in npm. It would choose incorrect commit ids inexplicably. Beyond that dependency upgrade time is faster.
- dhritzkiv 8y agoNot that this is a showstopper, but I have issues with the package-lock.json file where the `resolved` field (the package's registry URL) constantly flip flops between http and https protocols, depending on which machine I'm on (home, work, or docker container), whenever I run `npm install`. Sounds not so bad, but it becomes a mess in git, and causes any docker build caches to become invalidated.
- scrollaway 8y agoThat sounds pretty bad and I'm not so sure it's a npm bug. Do you have a diff of the change in question? Is it on the npm registry or a custom one?
- dhritzkiv 8y agoIt's on the npm registry, affecting the npm client: https://npm.community/t/some-packages-have-dist-tarball-as-http-and-not-https/285/51 https://npm.community/t/some-packages-have-dist-tarball-as-h...
- jwalton 8y agoA very similar bug that we run into sometimes: https://npm.community/t/npm-install-or-npm-update-turns-a-bunch-of-resolved-in-package-lock-json-from-real-values-to-false/3308 https://npm.community/t/npm-install-or-npm-update-turns-a-bu...
- whatever_dude 8y agoOh man, I get that all the time, hate it so much.
- janpot 8y agoRecently bumped into https://npm.community/t/packages-with-peerdependencies-are-incorrectly-hoisted/4794 https://npm.community/t/packages-with-peerdependencies-are-i... The attitude towards fixing issues ("we won’t be able to fix until we get through an upcoming tree builder rewrite.", yeah right...) is making me want to check out alternatives
- DevX101 8y agoJust moved to Yarn this weekend strictly because npm link (used to link to a local version of a package) doesn't work the way I want it to. Everytime I install a new package my previous `npm link` references break in the node_modules folder. `yarn link` keeps these reference. Just as I expect.
- mattigames 8y agoI just add a symlink to the folder inside node_modules (so it doesn't need to be on package.json), not the cleaneast but gets the job done.
- Aeolun 8y agoOne thing that comes to mind is the lockfile not actually acting as a lockfile. Running ‘npm install’ updates the lockfile :/ Then there was the issue where it didn’t respect git commit hashes that were added to the lockfile, just taking whatever the latest commit was.
- hiccuphippo 8y agoI switched back to npm with version 5 and it's been great. Is there a list somewhere of feature parity between both?
- nevir 8y agonpm has eroded so much of my trust that I am hesitant to switch back to it any time soon. I've tried npm out every few months (since npm 3), and have consistently run into infuriating bugs or unexpected behaviors. Much of it has been fixed over time, but the frequency and duration of these issues is concerning—and, I think, points to architectural deficiencies being the root of the problem. (And the project is so massive that it's understandably a really challenging thing to manage and triage) For example: * npm 5.0.0—5.7.0 didn't play nice with git-based dependencies (https://github.com/npm/npm/issues/17379 https://github.com/npm/npm/issues/17379) * npm 5.0.0—5.4.1 edits package-lock.json unexpectedly (https://github.com/npm/npm/issues/17979 https://github.com/npm/npm/issues/17979) * npm 5.0.0—5.4.? doesn't honor incompatible version differences in package.json compared to package-lock.json (https://github.com/npm/npm/issues/16866 https://github.com/npm/npm/issues/16866) * Take a look at the issues labeled as [big-bug], and how long they've languished (mostly from the v3 era): https://github.com/npm/npm/issues?q=is%3Aissue+is%3Aopen+sor.. https://github.com/npm/npm/issues?q=is%3Aissue+is%3Aopen+sor.... * and a bunch of others I can't remember off the top of my head; especially nondeterministic behavior in the v2 and v3 era.
- AgentME 8y ago* If you have OS-specific optional dependencies (Mac-only fsevents being a popular one, used by tools like webpack and watchify to massively speed up rebuilds on Mac), then if you run `npm install` on an OS that doesn't support them, then they get removed from package-lock.json. Then when the Mac user pulls the changed package-lock.json and reinstalls dependencies, fsevents isn't installed, and webpack and watchify fall back to a very slow path for watching for file changes. https://github.com/npm/npm/issues/17722 https://github.com/npm/npm/issues/17722 * Whenever I, a coworker, or our CI system pulls changes, we need to make sure that we have the correct dependencies installed because package.json or the lockfile may have been updated. We don't necessarily know if anyone else has changed package.json; we just want to run a command that makes sure node_modules matched the package.json and lockfile. Running `yarn` when there are no changes to package.json takes under a second, so it's easy to just always get in the habit of running, and doesn't slow down CI. We can make our build and deploy scripts just run `yarn` to be on the safe side because it's so cheap to run. But with npm, running `npm install` when there are no changes to package.json in a big project still often takes 10-30 seconds. * I've run into many bugs like this one with npm: https://github.com/npm/npm/issues/19839 https://github.com/npm/npm/issues/19839. For a while, I actually made our deploy script run `npm install` in a loop until it stopped changing things just to be sure it successfully installed everything (but then it turns out running `npm install` multiple times can actually cause issues! https://github.com/npm/npm/issues/18084 https://github.com/npm/npm/issues/18084. To work around that, if you pull changes that include a change to package.json, you have to remove node_modules and then run `npm install`. This made our CI system so slow...). I've reported various bugs like this. The bugs would get no attention, but sometimes they'd mysteriously go away after a few versions. But bugs that go away on their own tend to come back on their own in my experience. Yarn has only given me one issue in my use of it and it was promptly fixed. I swear by it now.