How Yarn 1 manages conflicting package versions

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • coding-garden

    Discontinued My digital garden on web development.

  • inside the repository with which I deployed this post which you are reading right now:

  • gatsby-themes

    Discontinued Gatsby themes for @maiertech websites. (by maiertech)

  • Yarn tells us that it found package @maiertech/gatsby-theme-posts-core at version 0.8.0, which is a dependency of @maiertech/gatsby-theme-digitial-garden. It also tells us that it hoisted this version, which makes sense because @maiertech /gatsby-theme-posts-core is used only once in the entire project.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • berry

    📦🐈 Active development trunk for Yarn ⚒

  • This post discusses the concept of hoisting, which is a staple of Yarn 1. Yarn 2's Plug'n'Play has addressed most issues around hoisting, making this post partially obsolete as soon as you move to Yarn 2. In this post Yarn (without version number) refers to Yarn 1.

  • Gatsby

    The best React-based framework with performance, scalability and security built in.

  • Yarn tells us that browserslist is a direct dependency of package gatsby and it appears a few more times in the dependecy tree. All specified versions of browserslist are compatible with version 4.16.3, which was the latest version when I created this output. Therefore, Yarn hoisted version 4.16.3. The entry for browserslist in yarn.lock reveals which version declarations it actually found, all of them compatible with 4.16.3:

  • semver

    Semantic Versioning Specification

  • The docs do not describe Yarn's hoisting algorithm, but mention certain hoisting guarantees. The conclusion is that you should not expect your node_modules folder to have a specific layout. As you will see later in this post, small changes in dependencies can cause big changes in the layout of node_modules. Another thing to keep in mind is that hoisting packages only works when package versions are compatible in a semantic versioning sense, i.e. they need to have the same major version number (but not 0).

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts