From e70a829047c23784c20eacb7e27eaca10a33f1c5 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 8 Mar 2024 12:16:57 +0200 Subject: [PATCH] fix: set `COREPACK_ENABLE_STRICT=0` in `runNpm` (#7747) * fix: set `COREPACK_ENABLE_STRICT=0` in `runNpm` * docs: add changesets * fix: compile * Update exec/run-npm/src/index.ts --------- Co-authored-by: Zoltan Kochan --- .changeset/thick-countries-deny.md | 6 ++++++ exec/run-npm/src/index.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/thick-countries-deny.md diff --git a/.changeset/thick-countries-deny.md b/.changeset/thick-countries-deny.md new file mode 100644 index 0000000000..733db07535 --- /dev/null +++ b/.changeset/thick-countries-deny.md @@ -0,0 +1,6 @@ +--- +"@pnpm/run-npm": patch +"pnpm": patch +--- + +The npm CLI executed from pnpm should not use Corepack [#7747](https://github.com/pnpm/pnpm/pull/7747). diff --git a/exec/run-npm/src/index.ts b/exec/run-npm/src/index.ts index fb023ccbf5..f6e0ff740b 100644 --- a/exec/run-npm/src/index.ts +++ b/exec/run-npm/src/index.ts @@ -14,7 +14,7 @@ export function runNpm (npmPath: string | undefined, args: string[], options?: R cwd: options?.cwd ?? process.cwd(), stdio: 'inherit', userAgent: undefined, - env: options?.env ?? {}, + env: { ...options?.env, COREPACK_ENABLE_STRICT: '0' }, }) }