-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Hey there, tried looking into this example to see how to setup monorepos with npm, lerna, or yarn (basically whichever tool involves the least banging of head against desk)
.. but this repo doesn't appear to be working the way you think it might. First, react-native
is hoisted into <root>/node_modules/react-native
, but due to a mismatch between semver strings "0.57.8"
and "^0.57.8"
(notice the leading caret), the originally installed version of react-native
is still installed at <root>/packages/mobile/node_modules/react-native
, i.e. Lerna is not pruning the hoisted dependency
You can get the correct hoisting behaviour by ensuring semver strings for react-native
in all of your packages/*/package.json
files are exactly the same, but then you have a new problem...
The mobile/android
and mobile/ios
projects are expected to find react native at ../node_modules/react-native
, relative to the platform root. Both of these platform projects would need to be updated to actually look for ../../../node_modules/react-native
to work
Let me know if you agree with these findings, and any thoughts you have on how we could fix them. Thanks!