Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation and questions on methods to keep yarn up to date on Windows #1021

Closed
dlong500 opened this issue Oct 13, 2016 · 9 comments
Closed

Comments

@dlong500
Copy link

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!

@AntJanus
Copy link

What problems on Windows are you having? npm install -g yarn worked pretty flawlessly for me.

@dlong500
Copy link
Author

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.

@dlong500
Copy link
Author

dlong500 commented Oct 13, 2016

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

@FLGMwt
Copy link
Contributor

FLGMwt commented Oct 14, 2016

@dlong500 yarn global add is a little broken on Windows right now (I'm actively working on a fix).

#676 should indeed fix self-update

@Daniel15
Copy link
Member

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.

@dlong500
Copy link
Author

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.

@Daniel15
Copy link
Member

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.

@Daniel15
Copy link
Member

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)

@wyze wyze removed the needs triage label Nov 10, 2016
@chinmayv
Copy link

chinmayv commented Nov 9, 2017

This worked for me...

  • rm -rf node_modules
  • Update NPM npm install -g npm
  • npm install
  • xcode clean (Cmd + Shift + k)
  • Build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants