文書の過去の版を表示しています。


pnpm - 高速、かつディスク容量効率が良いパッケージマネージャー

公式: インストール | 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

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

  • javascript/pnpm.1724565399.txt.gz
  • 最終更新: 2024/08/25 14:56
  • by ともやん