Skip to content

Cannot Install React Native for macOS #2930

@mssngr

Description

@mssngr

Environment

react-native -v: 0.81.6
npm ls react-native-macos: 0.81.7
node -v: 18.20.8
npm -v: 10.8.2
yarn --version: n/a
xcodebuild -version: Xcode 26.4.1, Build version 17E202

Steps to reproduce the bug

With react-native@0.81.2 per the Getting Started instructions:

  1. Follow the directions at https://microsoft.github.io/react-native-macos/docs/getting-started
  2. npx @react-native-community/cli init test --version 0.81.2
  3. cd test
  4. npx react-native-macos-init
  5. See error Command failed: npm install --save --silent "react-native-macos@^0.81.0-0"
  6. Manually input command npm install --save "react-native-macos@^0.81.0-0"
  7. See error:
npm error Found: react@19.1.0
npm error node_modules/react
npm error   react@"19.1.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^19.1.4" from react-native-macos@0.81.7

So, I tried with the latest patch version of react-native, 0.81.6

  1. npx @react-native-community/cli init test --version 0.81.6
  2. cd test
  3. npx react-native-macos-init
  4. See error:
styleText is not a function TypeError: styleText is not a function
    at upgradeFileContentChangedCallback (/Users/gbriel/dev/trader/node_modules/react-native-macos/local-cli/generator-common/index.js:354:20)
    at contentChangedCallback (/Users/gbriel/dev/trader/node_modules/react-native-macos/local-cli/generator-common/index.js:298:5)
    at copyAndReplace (/Users/gbriel/dev/trader/node_modules/react-native-macos/local-cli/generator-common/index.js:103:25)
    at copyAndReplaceWithChangedCallback (/Users/gbriel/dev/trader/node_modules/react-native-macos/local-cli/generator-common/index.js:304:3)
    at /Users/gbriel/dev/trader/node_modules/react-native-macos/local-cli/generator-common/index.js:323:5
    at Array.forEach (<anonymous>)
    at copyAndReplaceAll (/Users/gbriel/dev/trader/node_modules/react-native-macos/local-cli/generator-common/index.js:320:17)
    at /Users/gbriel/dev/trader/node_modules/react-native-macos/local-cli/generator-macos/index.js:55:26
    at Array.forEach (<anonymous>)
    at copyProjectTemplateAndReplace (/Users/gbriel/dev/trader/node_modules/react-native-macos/local-cli/generator-macos/index.js:55:5)

Cannot proceed forwards.

Expected Behavior

That I would be able to install react-native-macos and begin development

Actual Behavior

The process errors out and fails.

Reproducible Demo

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions