This will install the package with its latest stable version, and Yarn writes our package.json of that version with the caret range. The caret range is used by default when adding a package by running $ yarn add package-name ![]() This is because the versions we indicate can be a range.įor example, the ^caret ranges are specified as follows:Īllow changes that do not modify the first non-zero digit in the version, either the 3 in 3.1.4 or the 4 in 0.4.2. The installed version in our node_modules might not be the literal number we see in our package.json. ![]() Understanding the semantic versioning ranges Some apparently not the right direction, but they helped to gain some understanding of the situation. I mean, other than manually changing package.json? The current accepts the upgraded version 16.8.6, as indicated by yarn.lock.īut what is a proper way for me to upgrade dependency in this semantic situation? Namely, to upgrade dependency to latest package and indicating that my app now depends on that version? I had a rough understanding of what might have happened here. I then checked my yarn.lock and realized that the latest versions of my upgrading packages are already installed. Yarn's official doc clearly indicated that running such command should update the dependency here. A few results seemed to be indicating bug in earlier versions of Yarn. My first Google enquiry was yarn upgrade does not update package.json. Then I checked my package.json, nothing changed. ![]() Today I wanted to upgrade the dependency of React of one of my projects. Why Running `yarn upgrade` Does Not Update My `package.json`
0 Comments
Leave a Reply. |