Skip to content

Commit 471e973

Browse files
committed
fix: run macOS test-app scaffolding via pnpm dlx (avoid npm devEngines error)
The test-macos job failed at `init-macos-test-app`: it scaffolds the app with `npx @react-native-community/cli init` run from the workspace root, whose package.json now declares `devEngines.packageManager: pnpm`. npm 11 refuses to run (EBADDEVENGINES) because it isn't pnpm. Switch that single root-level invocation to `pnpm dlx` — pnpm doesn't enforce devEngines.packageManager (and satisfies it anyway). The remaining steps (`npm install`, `npx react-native-macos-init`) run inside the scaffolded standalone app directory, which isn't linked to the root as a workspace, so they keep using npm/npx unaffected. Keeps the devEngines guardrail intact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnwodAoNbqPec77191HVXn
1 parent 53bb9c8 commit 471e973

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scripts/init-macos-test-app.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ async function deletePreviousApp() {
2929

3030
async function initializeReactNativeTemplate() {
3131
console.log("Initializing community template");
32-
exec("npx", [
32+
// Use `pnpm dlx` rather than `npx` here: this runs from the workspace root,
33+
// whose package.json declares `devEngines.packageManager: pnpm`, and npm 11
34+
// refuses (EBADDEVENGINES) to run when invoked as npm/npx. The subsequent
35+
// steps run inside the scaffolded, standalone macos-test-app directory (no
36+
// `workspaces` field links it to the root) and can keep using npm/npx.
37+
exec("pnpm", [
38+
"dlx",
3339
"@react-native-community/cli",
3440
"init",
3541
"MacOSTestApp",

0 commit comments

Comments
 (0)