title: Why nx serve doesn't work when installed globally with Yarn?
body: <p>I initiated an Nx workspace using <code>npx</code>:</p>
  <pre class="lang-sh prettyprint-override"><code>npx create-nx-workspace
  </code></pre>
  <p>I get this after nx finished bootstrapping my workspace:</p>
  <pre class="lang-sh prettyprint-override"><code> This means that you might have to use &quot;yarn nx&quot; or &quot;npx nx&quot; to execute command
  s in the workspace.
    Run &quot;yarn global add nx&quot; or &quot;npm install -g nx&quot; to be able to execute command
  directly.
  </code></pre>
  <p>I want execute command directly and want to use yarn so:</p>
  <pre class="lang-sh prettyprint-override"><code>yarn global add nx
  </code></pre>
  <p>and get success message:</p>
  <pre class="lang-sh prettyprint-override"><code>yarn global v1.22.10
  [1/4] Resolving packages...
  [2/4] Fetching packages...
  [3/4] Linking dependencies...
  [4/4] Building fresh packages...
  success Installed &quot;nx@12.5.8&quot; with binaries:
        - nx
  Done in 9.40s.
  
  </code></pre>
  <p>I cd into my workspace, and try to serve my 'todos' app using the nx cli that I installed previously:</p>
  <pre class="lang-sh prettyprint-override"><code>cd myorg
  nx serve todos
  </code></pre>
  <p>but I get this error:</p>
  <pre class="lang-sh prettyprint-override"><code>bash: nx: command not found
  </code></pre>
  <p>I restarted my terminal and tried to <code>serve</code> again but got the same error. <code>serve</code> works if I do <code>yarn nx serve todos</code>, but, I would love to learn why and how I can make the direct command work with Yarn.</p>