pnpm / pnpm

Fast, disk space efficient package manager
https://pnpm.io
MIT License
29.94k stars 1.02k forks source link

Running `pnpm create` or `pnpm dlx` on root of a drive on Windows throws `EPERM: operation not permitted, mkdir` error. #5276

Open kidyudiqy opened 2 years ago

kidyudiqy commented 2 years ago

On Windows, running pnpm create on the root of a drive (C:\, D:\, etc) throws EPERM: operation not permitted, mkdir <drive letter>. Additionally, running pnpm dlx with any package also fails with the same error if done on the root of a drive.

pnpm version: 7.9.5

Code to reproduce the issue:

PS C:\Users\kidyu> cd ../..
PS C:\> # now we're in the root of drive C
PS C:\> pnpm create vite
 EPERM  EPERM: operation not permitted, mkdir 'C:\'

PS C:\> # errors, switching to another drive and try pnpm dlx
PS C:\> K:
PS K:\> pnpm dlx create-react-app ./my-app
 EPERM  EPERM: operation not permitted, mkdir 'K:\'

PS K:\> # still errors
PS K:\> # cd into any folder and use the command inside a folder
PS K:\> mkdir test; cd test
PS K:\test> pnpm create vite
../.pnpm-store/v3/tmp/dlx-125556         |   +6 +
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: K:\.pnpm-store\v3
  Virtual store is at:             ../.pnpm-store/v3/tmp/dlx-125556/node_modules/.pnpm
../.pnpm-store/v3/tmp/dlx-125556         | Progress: resolved 6, reused 6, downloaded 0, added 6, done
√ Project name: ... vite-project
√ Select a framework: » vanilla
√ Select a variant: » vanilla

Scaffolding project in K:\test\vite-project...

Done. Now run:

  cd vite-project
  pnpm install
  pnpm run dev

PS K:\test> # command succeded when run inside a folder on the same drive.

Expected behavior:

Should be able to use pnpm create to create new project or use pnpm dlx on the root of the drive, just like when running them inside a folder.

Actual behavior:

Command fails with EPERM: operation not permitted, mkdir

Additional information:

wrlliam commented 2 years ago

Did you ever find a fix for this?

realyangchuan commented 2 years ago

The same ERROR in version 7.17.0 now.

oyal commented 1 year ago

Encountered the same problem.

pinecone-squirrel commented 1 year ago

8.6.6一样出现了这个问题