目次
文書の過去の版を表示しています。
pnpm - 高速、かつディスク容量効率が良いパッケージマネージャー
本家: Fast, disk space efficient package manager | pnpm (英語)
Fast, disk space efficient package manager | pnpm (日本語)
ソースコード: GitHub - pnpm/pnpm: Fast, disk space efficient package manager
ライセンス: MIT License
インストール
公式: インストール | pnpm
スタンドアロンスクリプトを使用してインストールする😉
$ curl -fsSL https://get.pnpm.io/install.sh | sh -
==> Downloading pnpm binaries 9.8.0
WARN using --force I sure hope you know what you are doing
Copying pnpm CLI from /tmp/tmp.mOCIb0d59q/pnpm to /home/tomoyan/.local/share/pnpm/pnpm
Appended new lines to /home/tomoyan/.zshrc
Next configuration changes were made:
export PNPM_HOME="/home/tomoyan/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
To start using pnpm, run:
source /home/tomoyan/.zshrc
$ . ~/.zshrc
公式: pnpm env <cmd> | pnpm
Node.js LTS をインストールする🤔
$ pnpm env add -g lts
Fetching Node.js 20.17.0 ... Node.js 20.17.0 was installed /home/tomoyan/.local/share/pnpm/nodejs/20.17.0 All specified Node.js versions were installed
Or
$ pnpm env use -g lts
Node.js 20.17.0 was installed /home/tomoyan/.local/share/pnpm/nodejs/20.17.0 Node.js 20.17.0 was activated /home/tomoyan/.local/share/pnpm/node -> /home/tomoyan/.local/share/pnpm/nodejs/20.17.0/bin/node
トラブルシューティング
pnpm env add -g できない😅
anyenv - rbenv スタイルのオールインワン環境マネージャー でインストールした場合など、pnpm でNode.js の管理ができない😢
$ pnpm env add -g lts
ERR_PNPM_CANNOT_MANAGE_NODE Unable to manage Node.js because pnpm was not installed using the standalone installation script
If you want to manage Node.js with pnpm, you need to remove any Node.js that was installed by other tools, then install pnpm using one of the standalone scripts that are provided on the installation page: https://pnpm.io/installation
ERR_PNPM_CANNOT_MANAGE_NODE pnpm がスタンドアロン インストール スクリプトを使用してインストールされていないため、Node.js を管理できません
pnpm を使用して Node.js を管理する場合は、他のツールによってインストールされた Node.js をすべて削除し、インストール ページで提供されるスタンドアロン スクリプトの 1 つを使用して pnpm をインストールする必要があります: https://pnpm.io/installation
スタンドアロンスクリプトを使用してインストールし直す😉
$ npm uninstall -g pnpm
removed 1 package in 680ms
$ curl -fsSL https://get.pnpm.io/install.sh | sh -
==> Downloading pnpm binaries 9.8.0
WARN using --force I sure hope you know what you are doing
Copying pnpm CLI from /tmp/tmp.mOCIb0d59q/pnpm to /home/tomoyan/.local/share/pnpm/pnpm
Appended new lines to /home/tomoyan/.zshrc
Next configuration changes were made:
export PNPM_HOME="/home/tomoyan/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
To start using pnpm, run:
source /home/tomoyan/.zshrc
$ . ~/.zshrc
Node.js LTS をインストールする🤔
$ pnpm env add -g lts
Fetching Node.js 20.17.0 ... Node.js 20.17.0 was installed /home/tomoyan/.local/share/pnpm/nodejs/20.17.0 All specified Node.js versions were installed