title: Alias yarn to yarnpkg to avoid conflict with Hadoop Yarn
body: <p>I have Yarn (package manager) already installed on my machine, but I now have to install Apache Hadoop. When I tried doing that with <code>brew install hadoop</code>, I got the error -</p>
  
  <pre><code>Error: Cannot install hadoop because conflicting formulae are installed.
    yarn: because both install `yarn` binaries
  
  Please `brew unlink yarn` before continuing.
  
  Unlinking removes a formula's symlinks from /usr/local. You can
  link the formula again after the install finishes. You can --force this
  install, but the build may fail or cause obscure side-effects in the
  resulting software.
  </code></pre>
  
  <p>This seems to be because Hadoop's Yarn conflicts with yarn from yarnpkg.</p>
  
  <p>As mentioned <a href="https://github.com/yarnpkg/yarn/issues/673" rel="noreferrer">here</a>, they have no intention of renaming yarnpkg's yarn, but they have <a href="https://github.com/yarnpkg/yarn/commit/cefa9a368dd3df1a1f1ecd9e50de9c5fabefbc92" rel="noreferrer">added <code>yarnpkg</code> as an alias to <code>yarn</code></a>. </p>
  
  <p>This <a href="https://stackoverflow.com/questions/44739402/hadoop-yarn-vs-yarn-package-manager-command-conflict">SO answer</a> just mentions using <code>yarnpkg</code> instead of <code>yarn</code> to avoid the conflict, but there's no steps on how to do so.</p>
  
  <p>I'd appreciate any help on how to setup <code>yarnpkg</code> alias so that I can install Hadoop alongside yarn.</p>