npm / npm/cli

[BUG] Windows monorepo only: EISDIR: illegal operation on a directory, symlink

Open
#6,005 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 9.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

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

Running npm install in a mono repo in Windows causes an error:

npm ERR! code EISDIR
npm ERR! syscall symlink
npm ERR! path Z:\vscode-mdx\demo
npm ERR! dest Z:\vscode-mdx\node_modules\@mdx-js\monaco-demo
npm ERR! errno -4068
npm ERR! EISDIR: illegal operation on a directory, symlink 'Z:\vscode-mdx\demo' -> 'Z:\vscode-mdx\node_modules\@mdx-js\monaco-demo'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\remco\AppData\Local\npm-cache\_logs\2022-12-29T15_29_33_735Z-debug-0.log
Expected Behavior

I expect to be able to run npm install in a mono repo in Windows.

Steps To Reproduce
  1. Using Windows, clone remcohaszing/vscode-mdx and switch to the intellisense branch.
    git clone git@github.com:remcohaszing/vscode-mdx.git
    cd vscode-mdx
    git switch intellisense
    
  2. Now run npm install
  3. This results in the error described above
Environment
  • npm: 9.2.0
  • Node.js: 19.3.0
  • OS Name: Windows 11
  • System Model Name: VirtualBox
  • npm config:
; "builtin" config from C:\Program Files\nodejs\node_modules\npm\npmrc

prefix = "C:\\Users\\remco\\AppData\\Roaming\\npm"

; "project" config from Z:\vscode-mdx\.npmrc

package-lock = false

; "cli" config from command line options

location = "project"

; node bin location = C:\Program Files\nodejs\node.exe
; node version = v19.3.0
; npm local prefix = Z:\vscode-mdx
; npm version = 9.2.0
; cwd = Z:\vscode-mdx
; HOME = C:\Users\remco
; Run `npm config ls -l` to show all defaults.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure on Windows by cloning remcohaszing/vscode-mdx, switching to the intellisense branch, and running npm install. Investigate npm's monorepo symlink handling for the demo path and verify that installation completes without the EISDIR error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.