How to make a linked component peerDepdencies use the equivalent node_modules of the script being linked to? <ul> <li>I am using <a href="/questions/tagged/npm" class="post-tag" title="show questions tagged &#39;npm&#39;" rel="tag">npm</a> version 3 (version relevant because of <a href="https://github.com/npm/npm/issues/5875" rel="nofollow">the new way <code>peerDependencies</code> behave in version 3</a>).</li> <li>I have a <a href="/questions/tagged/reactjs" class="post-tag" title="show questions tagged &#39;reactjs&#39;" rel="tag">reactjs</a> app called "game" and a <a href="/questions/tagged/reactjs" class="post-tag" title="show questions tagged &#39;reactjs&#39;" rel="tag">reactjs</a> component called "player".</li> <li>I am using <code>webpack-dev-server</code> to run "game" app.</li> <li><code>react</code> and <code>react-dom</code> are dependencies of <code>game</code> app and <code>peerDependencies</code> of the <code>player</code> component.</li> </ul> <p>I would like to link <code>player</code> component to <code>game</code> app.</p> <p>I have done:</p> <pre class="lang-bash prettyprint-override"><code>cd /player npm link cd /game npm link player </code></pre> <p>When I run <code>webpack-dev-server</code> program, I get the following error message:</p> <pre><code>Hash: 09968e7401389f50049f Version: webpack 1.12.2 Time: 339ms chunk {0} app.js, 0.14192ce06d8b6f8abb91.hot-update.js, app.css (app) 2.32 MB + 576 hidden modules ERROR in ../player/index.js Module not found: Error: Cannot resolve module 'react' in /player @ ../player/index.js 21:13-29 </code></pre> <p>How do I make <code>player</code> component to use <code>game</code> <code>./node_modules</code> for the <code>peerDependences</code>?</p>