pnpm remove
별칭: rm, uninstall, un
node_modules와 프로젝트의 package.json에서 패키지를 제거합니다.
Since v11.28.0, pnpm remove runs the project's own preuninstall, uninstall, and postuninstall scripts. See Uninstall scripts.
옵션#
--recursive, -r#
워크스페이스 내에서 사용하면 모든 워크스페이스 패키지에서 종속성(하나 또는 여러 개)을 제거합니다.
워크스페이스 내에서 사용되지 않는 경우 하위 디렉토리에서 찾은 모든 패키지에서 의존성을 에서 제거합니다.
Since v11.28.0, the command fails before any package.json is modified if a requested dependency is absent from every selected project. The check respects --save-prod, --save-dev, and --save-optional.
--global, -g#
전역 패키지를 제거합니다.
--save-dev, -D#
devDependencies에서만 종속성을 제거합니다.
--save-optional, -O#
optionalDependencies에서만 종속성을 제거합니다.
--save-prod, -P#
dependencies에서만 종속성을 제거합니다.
--unsafe-perm#
Added in: v11.26.0
Accepted for compatibility with pnpm install; see unsafePerm.
Supply-chain policy flags#
Added in: v11.26.0
pnpm remove accepts the same policy overrides as pnpm install and pnpm add: --trust-lockfile, --no-trust-lockfile, --trust-policy, --trust-policy-exclude, and --trust-policy-ignore-after.
Removing a package rewrites the lockfile, so pnpm remove verifies the whole lockfile against the active policies the way pnpm install does, not only the entries of the package being removed. --trust-lockfile skips that pass entirely.