Have been using yarn upgrade --exact. The flag forces the command to override package.json no matter how the version constraint is declared.
yarn upgrade --exact
package.json
yarn upgrade react --latest --exact
Actually, discovered that sometimes package.json is not being updated.
Looks like yarn add is more reliable than yarn upgrade:
yarn add
yarn upgrade
yarn add react --exact
The downside it will install a new package if it has not been installed yet.
This technique can be used to upgrade all packages in a given scope:
jq -r '.dependencies | keys | .[] | select(startswith("@myscope/"))' package.json | xargs yarn add --exact
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Have been using
yarn upgrade --exact. The flag forces the command to overridepackage.jsonno matter how the version constraint is declared.Actually, discovered that sometimes
package.jsonis not being updated.Looks like
yarn addis more reliable thanyarn upgrade:The downside it will install a new package if it has not been installed yet.
This technique can be used to upgrade all packages in a given scope: