<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">When running <code class="notranslate">npm ci</code> in a directory with an existing <code class="notranslate">node_modules</code> that contains a <code class="notranslate">.bin</code> directory, the command fails with the following exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="43 verbose stack SystemError [ERR_FS_EISDIR]: Path is a directory: rm returned EISDIR (is a directory) {PATH_TO_PROJECT}/node_modules/.bin
43 verbose stack     at new SystemError (node:internal/errors:250:5)
43 verbose stack     at new NodeError (node:internal/errors:361:7)
43 verbose stack     at node:internal/fs/utils:784:17
43 verbose stack     at callback (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:306:20)
43 verbose stack     at FSReqCallback.oncomplete (node:fs:191:5)"><pre class="notranslate"><code class="notranslate">43 verbose stack SystemError [ERR_FS_EISDIR]: Path is a directory: rm returned EISDIR (is a directory) {PATH_TO_PROJECT}/node_modules/.bin
43 verbose stack     at new SystemError (node:internal/errors:250:5)
43 verbose stack     at new NodeError (node:internal/errors:361:7)
43 verbose stack     at node:internal/fs/utils:784:17
43 verbose stack     at callback (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:306:20)
43 verbose stack     at FSReqCallback.oncomplete (node:fs:191:5)
</code></pre></div>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Expect <code class="notranslate">npm ci</code> to work regardless of if the <code class="notranslate">node_modules</code> directory already exists.</p>
<h3 dir="auto">Steps To Reproduce</h3>
<ol dir="auto">
<li>With this config<br>
Sample <code class="notranslate">package.json</code></li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;name&quot;: &quot;esbuild-binary&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;description&quot;: &quot;&quot;,
  &quot;main&quot;: &quot;index.js&quot;,
  &quot;author&quot;: &quot;&quot;,
  &quot;license&quot;: &quot;ISC&quot;,
  &quot;dependencies&quot;: {
    &quot;esbuild&quot;: &quot;^0.14.13&quot;
  }
}
"><pre class="notranslate"><code class="notranslate">{
  "name": "esbuild-binary",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "author": "",
  "license": "ISC",
  "dependencies": {
    "esbuild": "^0.14.13"
  }
}

</code></pre></div>
<ol start="2" dir="auto">
<li>Generate lockfile then run <code class="notranslate">npm ci</code></li>
</ol>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>npm: 9.3.0</li>
<li>Node.js: 19.4.0</li>
<li>OS Name: MacOS Monterey 12.6.1</li>
<li>System Model Name: Macbook Pro</li>
</ul>
<p dir="auto">I am using a link from<br>
<a href="https://github.com/ionicthemes/ionic-facebook-login">https://github.com/ionicthemes/ionic-facebook-login</a><br>
and use this theme in app building first I have clone it then we use ionic serve and got error</p>
<blockquote>
<p dir="auto">ng.cmd run app:serve --host=localhost --port=8100<br>
[ng] An unhandled exception occurred: Could not find module "@angular-devkit/build-angular" from "C:\Users\Avaneesh Shukla\Desktop\Avaneesh\facebook\ionic-facebook-login".<br>
[ng] See "C:\Users\AVANEE~1\AppData\Local\Temp\ng-Dp5pqX\angular-errors.log" for further details.<br>
[ERROR] ng has unexpectedly closed (exit code 127).<br>
The Ionic CLI will exit. Please check any output above for error details.<br>
then use npm install and got error<br>
C:\Users\Avaneesh Shukla\Desktop\Avaneesh\facebook\ionic-facebook-login&gt;npm install<br>
npm ERR! cb() never called!</p>
</blockquote>
<p dir="auto">npm ERR! This is an error with npm itself. Please report this error at:<br>
npm ERR!     <a href="https://npm.community" rel="nofollow">https://npm.community</a></p>
<p dir="auto">npm ERR! A complete log of this run can be found in:<br>
npm ERR!     C:\Users\Avaneesh Shukla\AppData\Roaming\npm-cache_logs\2019-12-25T18_14_36_368Z-debug.log<br>
this is happen after anguler new version came</p>