antfu-collective / ni

💡 Use the right package manager
MIT License
6.25k stars 208 forks source link

EPERM: operation not permitted #193

Open ianzone opened 9 months ago

ianzone commented 9 months ago

Describe the bug

yihen@think MINGW64 ~
$ ni -g typescript
Already up to date
Progress: resolved 38, reused 38, downloaded 0, added 0, done
 EPERM  EPERM: operation not permitted, open 'C:\Users\yihen\AppData\Local\pnpm\ni'

and the file 'C:\Users\yihen\AppData\Local\pnpm\ni' is removed after execution

Reproduction

using git bash windows to install global packages like above

System Info

System:
    OS: Windows 11 10.0.22621
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13800H
    Memory: 18.51 GB / 31.66 GB
  Binaries:
    Node: 20.10.0 - ~\AppData\Local\pnpm\node.EXE
    npm: 10.2.3 - ~\AppData\Local\pnpm\npm.CMD
    pnpm: 8.11.0 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Chromium (119.0.2151.97)
    Internet Explorer: 11.0.22621.1

Used Package Manager

pnpm

Validations

HawtinZeng commented 9 months ago

Maybe you should run your command in a elevated PowerSheel or Command Prompt. I rarely use MINGW64 : )