Skip to content

Conversation

Copy link

Copilot AI commented Jun 30, 2025

The yarn start command in packages/rn-tester was failing because the binary name in the react-native package didn't match the package name react-native-macos.

Problem

  • Running yarn start in packages/rn-tester resulted in "command not found: react-native-macos"
  • Users had to use npx react-native-macos start as a workaround
  • The issue was that the bin field in packages/react-native/package.json defined the binary as "react-native" instead of "react-native-macos"

Solution

  1. Updated binary name: Changed the bin field in packages/react-native/package.json from "react-native": "cli.js" to "react-native-macos": "cli.js" to match the package name
  2. Fixed script paths: Updated the start and android scripts in packages/rn-tester/package.json to use the correct relative path to the binary: ../../node_modules/.bin/react-native-macos

Testing

  • yarn start now works from packages/rn-tester directory
  • yarn start works from root directory (delegates to rn-tester)
  • npx react-native-macos start continues to work as before
  • ✅ Test scripts in scripts/objc-test.sh continue to work (they use yarn start from rn-tester context)

Both the standard React Native workflow (yarn start) and the existing workaround (npx react-native-macos start) now function correctly.

Fixes #2528.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/react-native-community/rn-diff-purge/tags
    • Triggering command: node /home/REDACTED/work/react-native-macos/react-native-macos/node_modules/.bin/react-native start (http block)
    • Triggering command: node ../../node_modules/.bin/react-native-macos start (http block)
    • Triggering command: /usr/local/bin/node ../../node_modules/.bin/react-native-macos start (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] In packages/rn-tester, running yarn start no longer launches metro Fix yarn start command in rn-tester by updating binary name and script paths Jun 30, 2025
Copilot AI requested a review from Saadnajmi June 30, 2025 17:55
Copilot finished work on behalf of Saadnajmi June 30, 2025 17:55
Copy link
Author

Copilot AI commented Jun 30, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/react-native-community/rn-diff-purge/tags
    • Triggering command: /usr/local/bin/node ../../node_modules/.bin/react-native-macos start (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from Saadnajmi June 30, 2025 18:15
Copilot finished work on behalf of Saadnajmi June 30, 2025 18:15
Copilot finished work on behalf of Saadnajmi June 30, 2025 18:21
Copy link
Author

Copilot AI commented Jun 30, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/react-native-community/rn-diff-purge/tags
    • Triggering command: node ../../node_modules/.bin/react-native-macos start (http block)
    • Triggering command: node /home/REDACTED/work/react-native-macos/react-native-macos/node_modules/.bin/react-native-macos start (http block)
    • Triggering command: /usr/local/bin/node ../../node_modules/.bin/react-native-macos start (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of Saadnajmi June 30, 2025 18:48
@Saadnajmi
Copy link
Collaborator

@copilot can you revert the changes to package.json and create a fix that does not involve hardcoding paths to node_modules?

Copy link
Author

Copilot AI commented Jun 30, 2025

@copilot can you revert the changes to package.json and create a fix that does not involve hardcoding paths to node_modules?

I've reverted the package.json changes and implemented a solution that doesn't use hardcoded node_modules paths. The fix now uses yarn workspace react-native-macos exec react-native which leverages yarn's workspace binary resolution. This maintains clean scripts while still making yarn start work correctly. Changes in commit f5a0ef9.

Copilot finished work on behalf of Saadnajmi June 30, 2025 19:00
@Saadnajmi
Copy link
Collaborator

@copilot can we keep yarn start as an alias of react-native-macos start?

Copy link
Author

Copilot AI commented Jun 30, 2025

@copilot can we keep yarn start as an alias of react-native-macos start?

I've updated the solution to keep yarn start as a simple alias for react-native-macos start. The fix now uses npx react-native-macos start which provides clean, simple commands while ensuring proper binary resolution in yarn workspaces. Both yarn start from rn-tester and root directories now work correctly. Changes in commit b3a5827.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/react-native-community/rn-diff-purge/tags
    • Triggering command: node ../../node_modules/.bin/react-native-macos start (http block)
    • Triggering command: node /home/REDACTED/work/react-native-macos/react-native-macos/node_modules/.bin/react-native-macos start (http block)
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/react-native-macos/react-native-macos/node_modules/.bin/react-native-macos start (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of Saadnajmi June 30, 2025 19:41
Copy link
Author

Copilot AI commented Jun 30, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/react-native-community/rn-diff-purge/tags
    • Triggering command: node /home/REDACTED/work/react-native-macos/react-native-macos/node_modules/.bin/react-native-macos start (http block)
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/react-native-macos/react-native-macos/packages/react-native/cli.js start (http block)
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/react-native-macos/react-native-macos/node_modules/.bin/react-native-macos start (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from Saadnajmi June 30, 2025 20:59
Copilot finished work on behalf of Saadnajmi June 30, 2025 20:59
@Saadnajmi Saadnajmi changed the title Fix yarn start command in rn-tester by updating binary name and script paths fix: epose react-native-macos cli commands Jun 30, 2025
@Saadnajmi Saadnajmi marked this pull request as ready for review June 30, 2025 21:03
@Saadnajmi Saadnajmi changed the title fix: epose react-native-macos cli commands fix: expose react-native-macos cli commands Jun 30, 2025
@Saadnajmi
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Saadnajmi Saadnajmi merged commit 4a29cef into main Jul 1, 2025
24 of 26 checks passed
@Saadnajmi Saadnajmi deleted the copilot/fix-2528 branch July 1, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In packages/rn-tester, running yarn start no longer launches metro

4 participants