pnpm: pnpm self-update fails on Windows 11 (EPERM: operation not permitted, unlink)

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

10.5.1

Which area(s) of pnpm are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

pnpm self-update

Describe the Bug

Running pnpm self-update on Windows 11 results in an error saying that because pnpm.exe already exists it cannot be unlinked. I tried this using powershell opened in Administrator mode.

Looks like it’s recommended to use other means to install pnpm on Windows so I am moving away from using the Powershell install. Didn’t realize there were other ways to install since the Powershell method is at the top of the “Getting Started” page.

Nothing to stop. No server is running for the store at C:\Users\frank\AppData\Local\pnpm\store\v10
 WARN  The target bin directory already contains an exe called pnpm, so removing C:\Users\frank\AppData\Local\pnpm\pnpm.EXE
 EPERM  EPERM: operation not permitted, unlink 'C:\Users\frank\AppData\Local\pnpm\pnpm.EXE'
Image

Expected Behavior

pnpm self-update should update to the latest version as expected

Which Node.js version are you using?

22.14.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 9
  • Comments: 15 (2 by maintainers)

Most upvoted comments

@thebjorn @kadirmetin @frankhale I figured my own issue out, after this thread, so wanted to share my fix. If like me, the issue is likely because, you or your users have pnpm install twice - one as local user, and another globally. I had originally installed via a windows installer, and that installed it locally, but when using npm, it installed another version with npm, so there were conflicts in vscode gitbash. $ where pnpm C:\Users\USERNAME\AppData\Local\pnpm\pnpm.exe C:\Users\USERNAME\AppData\Roaming\npm\pnpm C:\Users\USERNAME\AppData\Roaming\npm\pnpm.cmd When I deleted all these folders, and ran: npm install -g pnpm

or, it already intalled globally:

pnpm self-update

Everything worked fine.