From 9f340c47d4da01f5dc07a8ac57b0e574a54cfc0a Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Tue, 23 Sep 2025 12:17:53 +0200 Subject: [PATCH] fix(windows): fix cannot find `@react-native-windows/cli/package.json` --- scripts/helpers.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/helpers.js b/scripts/helpers.js index d8e80d2ad..ef5dcec94 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -95,11 +95,15 @@ function readJSONFile(path, fs = nodefs) { * @param {string=} startDir * @returns {T} */ -function requireTransitive(dependencyChain, startDir = process.cwd()) { +function requireTransitive( + dependencyChain, + startDir = process.cwd(), + fs = nodefs +) { const p = dependencyChain.reduce((curr, next) => { const p = require.resolve(next + "/package.json", { paths: [curr] }); return path.dirname(p); - }, startDir); + }, fs.realpathSync(startDir)); return require(p); }