<h3 dir="auto">Is there an existing issue for this?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the existing issues</li>
</ul>
<h3 dir="auto">This issue exists in the latest npm version</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I am using the latest npm</li>
</ul>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Steps To Reproduce</h3>
<ol dir="auto">
<li>git clone <a href="https://github.com/lake2/npm_bug">https://github.com/lake2/npm_bug</a></li>
<li>cd ./npm_bug/b</li>
<li>npm i</li>
<li>antd is not be auto installed in b/node_modules</li>
</ol>
<p dir="auto">see <a href="https://github.com/npm/rfcs/blob/main/implemented/0025-install-peer-deps.md">https://github.com/npm/rfcs/blob/main/implemented/0025-install-peer-deps.md</a></p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>npm: 8.1.0</li>
<li>Node.js: v16.12.0</li>
<li>OS Name: windows</li>
<li>System Model Name: windows</li>
<li>npm config:</li>
</ul>
<div class="highlight highlight-source-ini notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="; &quot;user&quot; config from C:\Users\LH\.npmrc

//registry.npmjs.org/:_authToken = (protected)
registry = &quot;https://registry.npmjs.org/&quot;

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = D:\work\npm_bug\b
; HOME = C:\Users\LH
; Run `npm config ls -l` to show all defaults."><pre class="notranslate"><span class="pl-c"><span class="pl-c">;</span> "user" config from C:\Users\LH\.npmrc</span>

//registry.npmjs.org/:<span class="pl-k">_authToken</span> = (protected)
<span class="pl-k">registry</span> = <span class="pl-s"><span class="pl-pds">"</span>https://registry.npmjs.org/<span class="pl-pds">"</span></span>

<span class="pl-c"><span class="pl-c">;</span> node bin location = C:\Program Files\nodejs\node.exe</span>
<span class="pl-c"><span class="pl-c">;</span> cwd = D:\work\npm_bug\b</span>
<span class="pl-c"><span class="pl-c">;</span> HOME = C:\Users\LH</span>
<span class="pl-c"><span class="pl-c">;</span> Run `npm config ls -l` to show all defaults.</span></pre></div>
<h3 dir="auto">Current Behavior:</h3>
<p dir="auto">having 'library-project' with peer-dependencies adjacent to 'main-project'<br>
and 'main-project' with workspaces: ['../library-project'] (outside of 'main-project' folder)<br>
'npm install' in 'main-project' is not installing the peer-dependencies</p>
<p dir="auto">example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="library-project/
  package.json      // peerDependencies: {&quot;dep-a&quot;: &quot;1.0.0&quot;}
main-project/
  package.json      // &quot;workspaces&quot;: [ &quot;../library-project&quot; ]"><pre class="notranslate"><code class="notranslate">library-project/
  package.json      // peerDependencies: {"dep-a": "1.0.0"}
main-project/
  package.json      // "workspaces": [ "../library-project" ]
</code></pre></div>
<h3 dir="auto">Expected Behavior:</h3>
<p dir="auto">expecting node_modules in 'main-project' after 'npm i' to include 'dep-a':</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="node_modules
  library-project (linked)
  dep-a"><pre class="notranslate"><code class="notranslate">node_modules
  library-project (linked)
  dep-a
</code></pre></div>
<p dir="auto">actual result: missing 'dep-a' in node_modules</p>
<p dir="auto">this works fine if 'library-project' would be inside 'main-project'</p>
<h3 dir="auto">Steps To Reproduce:</h3>
<ol dir="auto">
<li>
<p dir="auto">main-project and library-project are two adjacent projects</p>
</li>
<li>
<p dir="auto">main-project package.json:</p>
</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;name&quot;: &quot;main-project&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;workspaces&quot;: [
    &quot;../library-project&quot;
  ],
  &quot;dependencies&quot;: {
    &quot;library-project&quot;: &quot;1.0.0&quot;
  }
}"><pre class="notranslate"><code class="notranslate">{
  "name": "main-project",
  "version": "1.0.0",
  "workspaces": [
    "../library-project"
  ],
  "dependencies": {
    "library-project": "1.0.0"
  }
}
</code></pre></div>
<ol start="3" dir="auto">
<li>library-project package.json:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;name&quot;: &quot;library-project&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;peerDependencies&quot;: {
    &quot;@angular/core&quot;: &quot;11.1.2&quot;
  }
}"><pre class="notranslate"><code class="notranslate">{
  "name": "library-project",
  "version": "1.0.0",
  "peerDependencies": {
    "@angular/core": "11.1.2"
  }
}
</code></pre></div>
<ol start="4" dir="auto">
<li>
<p dir="auto">run 'npm install' in 'main-project'</p>
</li>
<li>
<p dir="auto">expected "@angular/core" to be installed as it's a peer dependency of 'library-project'</p>
</li>
</ol>
<h3 dir="auto">Environment:</h3>
<ul dir="auto">
<li>Node: 15.6.0</li>
<li>npm: 7.5.2</li>
</ul>