YARN or NPM? Choose yarn. Right now!



  • I just wanted to put down a collection of links and info about why I think that yarn is the right choice in general, and why I feel that it is the direction that quasar should take.

    Time

    • npm install @babel/core --save > 12.721s reported vs 0m13.395s (time)
    • yarn add @babel/core > ✨ Done in 3.98s. reported vs 0m4.480s (time)

    Yarn has emoji. Interactive upgrading looks modernish. It caches and uses the cache intelligently. Less typing and less waiting means longer life - and faster CI.

    Registry problems (hits yarn & npm)

    • I am a teapot. Proxy requests broken, downgrade to Node 4 - fix made about 6 hours after report

    NPM PROBLEMS:

    Catastophic loss of files

    Yarn wins again:

    • Something that won’t work in npm, but works out of the box in yarn-managed package.json > “test-base”: “link:./packages/base”

    Management of and interaction with monorepos

    • No real strategy for this with NPM - lerna is the current frontrunner, and they even offer several “yarn-only” features, such as workspaces.
    • Also new on the scene (and promising) is bolt - which is yarn based.

    Yarn is deterministic and NPM is not. eg. The same lockfile can produce different installs on different machines or in different circumstances… (Thanks @panstromek)

    Comments?