pnpm add <pkg>
パッケージとそれが依存しているすべてのパッケージをインストールします。 デフォルトでは、すべての新しいパッケージは production 依存として追加されます。
TL;DR
| コマンド | 意味 | 
|---|---|
| pnpm add sax | Save to dependencies | 
| pnpm add -D sax | Save to devDependencies | 
| pnpm add -O sax | Save to optionalDependencies | 
| pnpm add -g sax  | グローバルにインストール | 
| pnpm add sax@next | Install from the nexttag | 
| pnpm add sax@3.0.0 | Specify version 3.0.0 | 
サポートされているパッケージの取得先
npm レジストリからインストール
pnpm add package-name will install the latest version of package-name from
the npm registry by default.
ワークスペースで実行された場合、最初に他のプロジェクトが指定された依存パッケージを使用しているかどうかを確認しようとします。 その場合、すでに使用されているバージョン範囲がインストールされます。
また、次のようにパッケージをインストールすることも可能です。
- tag: pnpm add express@nightly
- version: pnpm add express@1.0.0
- version range: pnpm add express@2 react@">=0.1.0 <0.2.0"
ワークスペースからインストール
Note that when adding dependencies and working within a workspace, packages
will be installed from the configured sources, depending on whether or not
link-workspace-packages is set, and use of the
workspace: range protocol.