[ ] I am removing an existing difference between facebook/react-native and microsoft/react-native-macos :thumbsup:
[ ] I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos :thumbsup:
[x] I am making a fix / change for the macOS implementation of react-native
[ ] I am making a change required for Microsoft usage of react-native
Summary:
After #2030 landed, running yarn start (an alias of react-native start) in packages/rn-tester leads to this error:
command not found: react-native
This seems to be because Yarn 4 is much stricter about only using declared dependencies as compared to Yarn 1, and RNTester's package.json only specifies react-native as a peer dependency (a "*" at that!):
What we want is tell RNTester ( a private package that will never be published) to use the workspace copy of react-native, rather than download from NPM. Luckily, modern package managers have the workspace:* syntax for exactly that! Let's update our package.json. I also had to specify react-native-macos as the dependency instead of react-native.
This fix won't work upstream in React Native, where yarn 1 doesn't support workspace:*, and the version needs to update for every nightly / stable release. I have prepared a separate fix there: https://github.com/facebook/react-native/pull/42756
Changelog:
[INTERNAL] [FIXED] - Fix running react-native start in rn-tester with yarn 4
Please select one of the following
Summary:
After #2030 landed, running
yarn start
(an alias ofreact-native start
) inpackages/rn-tester
leads to this error:This seems to be because Yarn 4 is much stricter about only using declared dependencies as compared to Yarn 1, and RNTester's package.json only specifies react-native as a peer dependency (a
"*"
at that!):What we want is tell RNTester ( a private package that will never be published) to use the workspace copy of react-native, rather than download from NPM. Luckily, modern package managers have the
workspace:*
syntax for exactly that! Let's update our package.json. I also had to specifyreact-native-macos
as the dependency instead of react-native.This fix won't work upstream in React Native, where yarn 1 doesn't support
workspace:*
, and the version needs to update for every nightly / stable release. I have prepared a separate fix there: https://github.com/facebook/react-native/pull/42756Changelog:
[INTERNAL] [FIXED] - Fix running
react-native start
in rn-tester with yarn 4Test Plan:
CI should pass.