I would like to keep all other package versions in tact, but upgrade one single package to the most recent version. How can I do that using yarn?
I know I can delete yarn.lock, and then run yarn install, but I think that will upgrade every package, which I don't want. I just want the most recent version of node-sass, and for that to override the version I have in yarn.lock.
How can this be done?
According to Yarn documentation:
yarn up [package]
yarn up [package]@[version]
yarn up [package]@[tag]
So, to upgrade node-sass, you should run:
yarn up node-sass
The answer by Rodrigo Merlone does not work with yarn-classic. For yarn-classic, a resolution is required.
{
"dependencies": {
"left-pad": "1.0.0",
"c": "file:../c-1",
"d2": "file:../d2-1"
},
"resolutions": {
"d2/left-pad": "1.1.1",
"c/**/left-pad": "^1.1.2"
}
}
More info: https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With