AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Install yarn on windows11/21/2023 If you have a few different libraries that depend on version 1.0.0 and a few that depend on 1.5.1, yarn will hoist one of those versions to the root of node_modules folder, but another one would have no place to go (only one version can sit at the root), and they will be installed as copies in node_modules folders of the libraries that use them. If you just run yarn add then in the yarn.lock you will see this picture:Įven though 1.5.1 and 1.0.0 versions are semver-compatible, yarn will not merge them into one as you’d expect, and you’ll end up with 2 versions of the same utils in the repo. After installing you’ll see in your yarn.lock file:Īfter a few months you want to add another library that depends on those utils, let’s say Utils library released a few bug fixes and features in the meantime, and its latest version is now 1.5.1, and on it. Imagine the situation: you’re adding library to your dependencies, which also depends on which is its latest version. Although yarn promises that deduplication isn’t necessary, this is not exactly the truth. If your project runs on yarn, then more likely than not some of your dependencies will be duplicated, even if they satisfy semver conditions. Below are three simple tricks that can help you shave off a minute or two, or sometimes even reduce your yarn install time by half □ When dealing with npm-based ecosystem and its myriads of packages, dependencies install time, especially in large projects, can be unreasonably long. Happier and faster developers equal happier customers, who get their features and bug fixes sooner! And speeding up working with code is not only fun, but also essential for building products fast. Dev productivity and quality of life improvements are a passion of mine.
0 Comments
Read More
Leave a Reply. |