Documentation and possibly a feature request as well
On Windows platforms, what is the recommended way for keeping yarn itself up to date?
Is it going to be different based on different install methods? In other words, if we install via .msi file will we need to manually check for new versions and download another .msi file?
I know that installing through NPM is listed as one possible install method, but that appears to have problems on Windows (at least for now). It would be nice if there was a way to have yarn update itself just as NPM can.
Thanks to all the contributors for great work so far!
What problems on Windows are you having? npm install -g yarn worked pretty flawlessly for me.
I had seen some references to problems, but I tried it and it works for me too. But that still doesn't answer the question of what is the recommended way to keep yarn up to date (or why it is listed as an _alternate_ method for Windows instead of the primary method for installing yarn in the first place).
There also is not a yarn global outdated command yet.
And I also just tried running yarn global add yarn and get various different errors (it seems like yarn tries to overwrite itself and that causes it to break down in random places).
I'm just looking for some type of canonical documentation on how to keep yarn updated on Windows directly from the developers.
Actually, I just found the yarn self-update command. However, when I run it I get:
yarn self-update v0.15.1
error OAuth2 authentication requires a token or key & secret to be set
at __dirname.authenticate (C:\Program Files (x86)\Yarn\node_modules\github\lib\index.js:334:23)
at Object.<anonymous> (C:\Program Files (x86)\Yarn\lib\cli\commands\self-update.js:28:12)
at next (native)
at step (C:\Program Files (x86)\Yarn\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\Program Files (x86)\Yarn\node_modules\babel-runtime\helpers\asyncToGenerator.js:35:14
at Promise.F (C:\Program Files (x86)\Yarn\node_modules\core-js\library\modules\_export.js:35:28)
at Object.<anonymous> (C:\Program Files (x86)\Yarn\node_modules\babel-runtime\helpers\asyncToGenerator.js:14:12)
at Object.run (C:\Program Files (x86)\Yarn\lib\cli\commands\self-update.js:97:17)
at run (C:\Program Files (x86)\Yarn\lib\cli\index.js:237:18)
at config.init.then (C:\Program Files (x86)\Yarn\lib\cli\index.js:345:12)
info Visit http://yarnpkg.com/en/docs/cli/self-update for documentation about this command.
Found this relevant issue #612 and this pull request #676
@dlong500 yarn global add is a little broken on Windows right now (I'm actively working on a fix).
On Windows platforms, what is the recommended way for keeping yarn itself up to date?
How did you install Yarn?
We have a Chocolatey package available now. If you install using Chocolatey, you can use choco upgrade to upgrade Yarn.
Unfortunately I haven't thought much about upgrades when using the Windows installer (MSI). Perhaps yarn self-update should download and run the installer if Yarn was installed via the installer.
I did install via the MSI file. Chocolatey is a nice platform but I currently would prefer a more simplistic approach. To my knowledge Chocolatey hasn't quite solved the conundrum of apps that self-update vs apps that don't, so package management on Windows platforms is still quite a bit messier that on other platforms.
In other words, I'd rather not have to deal with Chocolatey at the moment for a subset of apps that I use. I'd much rather prefer an app that can update itself. If yarn self-update could be made to do whatever is necessary for those that installed via MSI that would be great.
As a side note, it also might be nice to have some occasional check that is done to grab the most recent version number of yarn so a notification could be displayed when a command is run using an outdated version.
I created #1138 as a feature request for Yarn to periodically check the version number at startup, and optionally allow automatically upgrades. I think that covers your concerns in this issue, so I'm going to close this issue. Thank you for trying Yarn! 馃槃
But that still doesn't answer the question of what is the recommended way to keep yarn up to date (or why it is listed as an alternate method for Windows instead of the primary method for installing yarn in the first place).
See the last bit of #385's description. That was about Linux packaging, but a lot of the same arguments apply to Windows.
I also created #1139 to update yarn self-update to use the same installation method as what you originally used (so Yarn installed via MSI will also upgrade via MSI)
This worked for me...
rm -rf node_modulesnpm install -g npm
Most helpful comment
Actually, I just found the
yarn self-updatecommand. However, when I run it I get:Found this relevant issue #612 and this pull request #676