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 bun
npm (& node)
scoop install nodejs
yarn
scoop install yarn
pnpm
scoop install pnpm
バージョンを確認
scoop list
2024 年 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-ToolVersions
node version: v22.6.0bun version: 1.1.24npm version: 10.8.2yarn version: 1.22.22pnpm version: 9.7.1
アンインストール
bun
scoop uninstall bun
npm (& node)
scoop uninstall nodejs
yarn
scoop uninstall yarn
pnpm
scoop uninstall pnpm