Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows fails when making a symbolic link, causing the operating system to seize up. #6298

Open
zhenzhenChange opened this issue Mar 28, 2023 · 7 comments

Comments

@zhenzhenChange
Copy link

zhenzhenChange commented Mar 28, 2023

pnpm version: v7.29.3

Code to reproduce the issue:

A random working directory:

D:\repositories\workspaces-zhongzhen\control-variates\benchmark-18c2e40f-56c6-48ff-b4cf-dce4067a2941\fixtures\playground\pnpm\package.json

package.json :

{
  "name": "playgrounds",
  "type": "module",
  "private": true,
  "version": "0.0.0",
  "scripts": {
    "dev": "vite --open",
    "build": "tsc && vite build",
    "preview": "vite preview",
    "preinstall": "npx only-allow pnpm"
  },
  "dependencies": {
    "lil-gui": "^0.17.0",
    "mobx": "^6.7.0",
    "mobx-react-lite": "^3.4.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "rxjs": "^7.8.0",
    "three": "^0.147.0"
  },
  "devDependencies": {
    "@types/react": "^18.0.26",
    "@types/react-dom": "^18.0.10",
    "@types/three": "^0.146.0",
    "@vitejs/plugin-react": "^3.0.1",
    "@vitejs/plugin-react-swc": "^3.0.1",
    "typescript": "^4.9.4",
    "vite": "^4.0.4"
  }
}

Execution of commands:

pnpm i --cache-dir=.pnpm-cache --store-dir=.pnpm-store --ignore-scripts --no-strict-peer-dependencies

Results:

image

EPERM: operation not permitted, symlink

'D:\repositories\workspaces-zhongzhen\control-variates\benchmark-5f5f12d6-37f0-4ac8-a5ff-42aedde49ad4\fixtures\playground\pnpm\node_modules\.pnpm\registry.npmmirror.com+@babel+helper-module-transforms@7.21.2\node_modules\@babel\helper-module-transforms'

 ->

'D:\repositories\workspaces-zhongzhen\control-variates\benchmark-5f5f12d6-37f0-4ac8-a5ff-42aedde49ad4\fixtures\playground\pnpm\node_modules\.pnpm\node_modules\@babel\helper-module-transforms'

Expected behavior:

Ability to install correctly.

Actual behavior:

Symbolic link failed.

Additional information:

npx envinfo :

  System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz
    Memory: 13.66 GB / 23.72 GB
  Binaries:
    Node: 16.18.0 - C:\Program Files\nodejs\node.EXE

Disk Type: HDD


I ran it on another Windows system and had no problems.

So I'm not sure if it's a bug or an OS issue.

More specifically, I have gathered together a range of reasons why this problem has arisen:

  • It may be that my disk is corrupted, causing the link to fail.
  • Operating system permissions.
  • The path is too long, exceeding the 260 characters set by windows MAX_PATH.
    • However, I have removed this restriction and the link still fails (Operation steps).
    • And I had no problem installing it on another computer.

So I am looking for help with:

  • What else could be the cause?
  • Is it possible to catch these errors internally and not let the system seize up?

Because once this error happens, my disk occupancy reaches 100%, my system gets stuck and I have no choice but to force the shutdown button and restart the computer.

@zhenzhenChange
Copy link
Author

Since the problem is probably hardware (disk) related and not 100% reproducible, I can only speculate on the cause of the problem, so I won't provide a reproduction repository.

@zhenzhenChange
Copy link
Author

Suddenly a reason occurs to me, is it possible that the anti-virus software is blocking operations on this directory?

@zkochan
Copy link
Member

zkochan commented Apr 4, 2023

Not sure if it is the same issue but here in this PR to Bit I was also fixing an EPERM error: teambit/bit#7182

@zhenzhenChange
Copy link
Author

I'm not sure, my initial guess is that it's a problem under Windows with long paths.

@zhenzhenChange
Copy link
Author

I found a similar problem:

$ pnpm env use --global lts

image

Fetching Node.js 18.16.0 ...
 EPERM  EPERM: operation not permitted, symlink 'C:\Users\zhongzhen\AppData\Local\pnpm\nodejs\18.16.0\node.exe' -> 'C:\Users\zhongzhen\AppData\Local\pnpm\node.exe'

It is the same error, except that it is correctly caught and exits the program without causing the operating system to crash.

@zkochan

@zhenzhenChange
Copy link
Author

Oh yes, this problem exists in v8 as well, one could even say it started in v7?

@zkochan
Copy link
Member

zkochan commented Apr 19, 2023

The pnpm env issue should be fixed in v8.3.0 via #6405

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants