forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 157
Open
Labels
Description
Environment
react-native -v:
20.0.2
npm ls react-native-macos:
MacOSTestApp@0.0.1 /Users/kraen.hansen/Repositories/react-native-node-api/apps/macos-test-app
└── (empty)
node -v:
v22.19.0
npm -v:
10.9.3
yarn --version:
N/A
xcodebuild -version:
Xcode 16.2
Build version 16C5032aSteps to reproduce the bug
Following the steps https://microsoft.github.io/react-native-windows/docs/rnm-getting-started, while also passing --skip-install to the @react-native-community/cli init call:
npx @react-native-community/cli init MacOSTestApp --skip-install --version 0.78 --directory ./macos-test-appcd macos-test-appnpx react-native-macos-init
Expected Behavior
I'd expect to either:
- init the MacOS app in the newly created app without having to install dependencies, this is needed because I want to do this only once -- or
- get a nice error asking me to run
npm installbefore initializing the MacOS part.
Actual Behavior
I get the following error when running the last command:
Reading application name from package.json…
Reading react-native version from node_modules…
Reading react-native-macos version from node_modules…
Latest matching version of react-native-macos for react-native@0.81.4 is react-native-macos@0.79.0.
Installing react-native-macos@^0.79.0-0…
Command failed: npm install --save --silent "react-native-macos@^0.79.0-0" Error: Command failed: npm install --save --silent "react-native-macos@^0.79.0-0"
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:915:11)
at execSync (node:child_process:987:15)
at /Users/kraen.hansen/.npm/_npx/20f1505fae2cef5b/node_modules/react-native-macos-init/lib-commonjs/cli.js:228:42
at Generator.next (<anonymous>)
at fulfilled (/Users/kraen.hansen/.npm/_npx/20f1505fae2cef5b/node_modules/react-native-macos-init/lib-commonjs/cli.js:11:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
status: 1,
signal: null,
output: [ null, <Buffer >, <Buffer > ],
pid: 59058,
stdout: <Buffer >,
stderr: <Buffer >
}
Reproducible Demo
N/A
Additional context
Haven't dug more into this, but a workaround exists (running npm install or not passing --skip-install