Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
Can't npm ci if there's an existing .bin directory in node_modules
Expected Behavior
It deletes node_modules without crashing
Steps To Reproduce
Use this package.json
{
"name": "npm-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"eslint": "^8.31.0"
}
}
npm ci
npm ci
- It fails the second time
npm ERR! code ERR_FS_EISDIR
npm ERR! syscall rm
npm ERR! path /Users/justintoman/code/npm-test/node_modules/.bin
npm ERR! errno 21
npm ERR! Path is a directory: rm returned EISDIR (is a directory) /Users/justintoman/code/npm-test/node_modules/.bin
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/justintoman/.npm/_logs/2023-01-12T21_14_19_211Z-debug-0.log
Environment
- npm: 9.3.0
- Node.js: 18.12.1
- OS Name: MacOS Venture 13.1
- System Model Name: Macbook Pro
- npm config:
; node bin location = /Users/justintoman/.nvm/versions/node/v18.12.1/bin/node
; node version = v18.12.1
; npm local prefix = /Users/justintoman/code/npm-test
; npm version = 9.3.0
; cwd = /Users/justintoman/code/npm-test
; HOME = /Users/justintoman
; Run `npm config ls -l` to show all defaults.