0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

はじめに

Windows環境でpnpmの更新にはLinux等と比べて更新するのに少し手間がかかり、調べないと出てこなかったのでここにまとめようとおもいます。

通常通りには更新できない

Windows環境以外では、pnpm add -g pnpmで簡単に更新することができますが、Windows環境では次のエラーにより更新できないことがよくあります。

 EPERM: operation not permitted, unlink 'C:\Users\~~~\AppData\Local\pnpm\pnpm.EXE'

実際、Githubにも次のissuesがあります。

Corepackを有効にしてから更新

CorePackは、npmpnpmなどのパッケージマネージャを管理するマネージャのようです。

管理者でターミナルを開き、corepack enableしたのちにpnpm add -g pnpmを行うことで更新ができました。

C:\Windows\System32>pnpm -v
8.6.0
C:\Windows\System32>corepack enable

C:\Windows\System32>pnpm add -g pnpm
Nothing to stop. No server is running for the store at C:\Users\takuy\AppData\Local\pnpm\store\v3
The location of the currently running pnpm differs from the location where pnpm will be installed
 Current pnpm location: C:\Program Files\nodejs
 Target location: C:\Users\takuy\AppData\Local\pnpm

Packages: +1
+
Progress: resolved 1, reused 1, downloaded 0, added 1, done
 WARN  The target bin directory already contains an exe called pnpm, so removing C:\Users\takuy\AppData\Local\pnpm\pnpm.EXE

C:\Users\takuy\AppData\Local\pnpm\global\5:
+ pnpm ^9.4.0

Done in 1.1s

C:\Windows\System32>pnpm -v
9.4.0

C:\Windows\System32>

Windows環境でpnpmの更新に詰まっている場合はぜひ試してみてください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?