I am trying out the yarn self-update
command to see how it works, but instead of updating the Yarn version, it throws an OAuth error like so
yarn self-update
yarn self-update v0.15.1
error OAuth2 authentication requires a token or key & secret to be set
at __dirname.authenticate (/Users/nikjohn/.nvm/versions/node/v6.4.0/lib/node_modules/yarn/node_modules/github/lib/index.js:334:23)
at Object.<anonymous> (/Users/nikjohn/.nvm/versions/node/v6.4.0/lib/node_modules/yarn/lib/cli/commands/self-update.js:30:12)
at next (native)
at step (/Users/nikjohn/.nvm/versions/node/v6.4.0/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/nikjohn/.nvm/versions/node/v6.4.0/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
at new Promise (/Users/nikjohn/.nvm/versions/node/v6.4.0/lib/node_modules/yarn/node_modules/core-js/library/modules/es6.promise.js:191:7)
at Object.<anonymous> (/Users/nikjohn/.nvm/versions/node/v6.4.0/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12)
at Object.run (/Users/nikjohn/.nvm/versions/node/v6.4.0/lib/node_modules/yarn/lib/cli/commands/self-update.js:99:17)
at run (/Users/nikjohn/.nvm/versions/node/v6.4.0/lib/node_modules/yarn/lib/cli/index.js:237:18)
at config.init.then (/Users/nikjohn/.nvm/versions/node/v6.4.0/lib/node_modules/yarn/lib/cli/index.js:345:12)
info Visit http://yarnpkg.com/en/docs/cli/self-update for documentation about this command.
Does anybody know why this is and what needs to be done to resolve this? According to the docs here, this command does not have any such OAuth dependency and IMHO it shouldn't either.
Looks like there's a PR for this already here
Edit: Further research shows this is a known bug with Yarn. But a resolution is still not available. It would be a weird catch22 if the fix is pushed out as a new version, but users can't update because the command fails. One possible solution is yarn self-update [tag]
instead of yarn self-update
, but this remains a bug.*
Edit: I realized there's another workaround
yarn version
yarn version <version-number>