Movatterモバイル変換


[0]ホーム

URL:


メインコンテンツまでスキップ
Version: 10.x

pnpm exec

プロジェクトのスコープでシェルコマンドを実行します。

node_modules/.bin is added to thePATH, sopnpm exec allows executing commands of dependencies.

If you have Jest as a dependency of your project, there is no need to install Jest globally, just run it withpnpm exec:

pnpm exec jest

Theexec part is actually optional when the command is not in conflict with a builtin pnpm command, so you may also just run:

pnpm jest

Options

Any options for theexec command should be listed before theexec keyword.Options listed after theexec keyword are passed to the executed command.

良い例。 pnpm はこのコマンドを再帰的に実行します:

pnpm -r exec jest

Bad, pnpm will not run recursively butjest will be executed with the-r option:

pnpm exec jest -r

--recursive, -r

ワークスペースのすべてのプロジェクトでシェルコマンドを実行します。

The name of the current package is available through the environment variablePNPM_PACKAGE_NAME.

Prunenode_modules installations for all packages:

pnpm -r exec rm -rf node_modules

すべてのパッケージのパッケージ情報を表示する。 This should be used with the--shell-mode (or-c) option for the environment variable to work.

pnpm -rc exec pnpm view \$PNPM_PACKAGE_NAME

--no-reporter-hide-prefix

Do not hide prefix when running commands in parallel.

--resume-from <package_name>

特定のプロジェクトから実行を再開します。 このオプションは、大きなワークスペースを使用している場合に便利です。ビルド順序で前にあるすべてのプロジェクトを実行せずに、特定のプロジェクトからビルドを再開できます。

--parallel

Completely disregard concurrency and topological sorting, running a given scriptimmediately in all matching packages. このフラグは、多くのパッケージで長時間実行される処理、例えば、長時間のビルド処理に適しています。

--shell-mode, -c

シェル内でコマンドを実行します。 Uses/bin/sh on UNIX and\cmd.exe on Windows.

--report-summary

Read about this option in the run command docs

--filter <package_selector>

Read more about filtering.


[8]ページ先頭

©2009-2025 Movatter.jp