From 164469a0c424b8a6710b9f9b0d6f761ba289cec4 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:36:01 +0100 Subject: [PATCH] fix(react-native): `runMacOS.js` depends on `@react-native-community/cli-tools` (#1993) --- packages/react-native/local-cli/runMacOS/runMacOS.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/react-native/local-cli/runMacOS/runMacOS.js b/packages/react-native/local-cli/runMacOS/runMacOS.js index 3150655a06b247..31faa95f2358a7 100644 --- a/packages/react-native/local-cli/runMacOS/runMacOS.js +++ b/packages/react-native/local-cli/runMacOS/runMacOS.js @@ -28,11 +28,12 @@ const fs = require('fs'); const path = require('path'); const chalk = require('chalk'); const findXcodeProject = require('./findXcodeProject'); -const { - logger, - CLIError, - getDefaultUserTerminal, -} = require('@react-native-community/cli-tools'); +const {logger, CLIError, getDefaultUserTerminal} = (() => { + const cli = require.resolve('@react-native-community/cli/package.json'); + const options = {paths: [path.dirname(cli)]}; + const tools = require.resolve('@react-native-community/cli-tools', options); + return require(tools); +})(); /** * @param {string[]} _