pnpm pm

pnpm pm <command> 문법은 package.json에 같은 이름의 스크립트가 있더라도 항상 pnpm 내장 명령을 실행합니다.

일부 내장 명령은 스크립트로 재정의될 수 있습니다. 예를 들어, 프로젝트가 "clean" 스크립트를 package.json에 정의하면, pnpm clean은 내장 pnpm clean 대신 그 스크립트를 실행합니다. pnpm pm clean을 사용하면 내장 명령이 강제로 실행됩니다.

These commands run a same-named script when one exists:

An alias looks up its own script name, so pnpm rb runs an rb script, not a rebuild script.

Inside a workspace, running one of these commands from a subdirectory fails with ERR_PNPM_SCRIPT_OVERRIDE_IN_WORKSPACE_ROOT when the root package.json has a script of that name. Run pnpm pm <command> to use the built-in command, or pnpm run <command> from the workspace root to run the script.

예시#

package.json
{
  "scripts": {
    "clean": "rm -rf dist"
  }
}
# Runs the "clean" script from package.json
pnpm clean
# or explicitly:
pnpm run clean

# Runs the built-in pnpm clean command
pnpm pm clean