Windowsにbun, npm, yarn, pnpmをインストール
scoop をインストール
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserInvoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expressionこの scoop というインストーラーを使用して、bun, npm, yarn, pnpm をインストールします。
要約
bun
scoop install bunnpm (& node)
scoop install nodejsyarn
scoop install yarnpnpm
scoop install pnpmバージョンを確認
scoop list2024 年 8 月 20 日時点では以下のような結果になりました。
Installed apps:
Name   Version Source Updated             Info----   ------- ------ -------             ----bun    1.1.24  main   2024-08-20 00:40:09nodejs 22.6.0  main   2024-08-20 00:35:44pnpm   9.7.1   main   2024-08-20 00:40:19yarn   1.22.22 main   2024-08-20 00:40:15また、以下のコマンドでも確認可能です。内容としては、command --versionを実行しているだけです。
function Check-ToolVersions {    $tools = @("node", "bun", "npm", "yarn", "pnpm")
    foreach ($tool in $tools) {        try {            $version = & $tool --version 2>$null            if (-not $version) {                $version = "not installed"            }        } catch {            $version = "not installed"        }        "{0,-7} version: {1}" -f $tool, $version    }}
Check-ToolVersionsnode    version: v22.6.0bun     version: 1.1.24npm     version: 10.8.2yarn    version: 1.22.22pnpm    version: 9.7.1アンインストール
bun
scoop uninstall bunnpm (& node)
scoop uninstall nodejsyarn
scoop uninstall yarnpnpm
scoop uninstall pnpm