title: Npm workspaces - call workspace script from root package
body: <p>I'm struggling with multiple npm packages in a root git repository with custom dev scripts to handle launch, compile, build and so on. Now I came across npm workspaces and wanted to use this stunning new feature in my following project structure but I can't get it to work:</p>
  <pre><code>projectx (root)
  - package.json
  - apps   
   -- backend
     -- src
     -- package.json (name: @projectx/backend, scripts: &quot;dev&quot;:&quot;ts-node or whatever&quot;)
   -- common
     -- src
     -- package.json (name: @projectx/common)
   -- frontend
     -- src
     -- package.json (name: @projectx/frontend, scripts: &quot;dev&quot;:&quot;webpack&quot;)
  </code></pre>
  <p>My root package.json contains:</p>
  <pre><code>    {
    &quot;name&quot;: &quot;packagex&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;main&quot;: &quot;index.js&quot;,
    &quot;private&quot;: &quot;true&quot;,
    &quot;scripts&quot;: {
      &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;,
      &quot;back:dev&quot;: &quot;npm workspace @projectx/backend dev&quot;,
      &quot;front:dev&quot;: &quot;npm workspace @projectx/frontend dev&quot;,
      &quot;dev&quot;: &quot;run-p back:dev front:dev&quot;
    },
    &quot;workspaces&quot;: [
      &quot;apps/*&quot;
    ],
    &quot;repository&quot;: {
      &quot;type&quot;: &quot;git&quot;,
      &quot;url&quot;: &quot;git_url&quot;
    },
    &quot;author&quot;: &quot;me&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;devDependencies&quot;: {
      &quot;npm-run-all&quot;: &quot;^4.1.5&quot;
    }
  }
  </code></pre>
  <p>And now I want to start backend and frontend with npm-run-all and the command on root: npm run dev which results in:</p>
  <p><a href="https://i.stack.imgur.com/9CGKq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9CGKq.png" alt="Screenshot of terminal output" /></a></p>
  <p>And I also want to share the common package with backend and frontend, which should be possible in this case. Maybe anobody else is facing the same problem or has some ideas what I am doing wrong here.</p>