We have a mono-repo that I'm migrating to npm 7's workspaces.
Current folder org:
\React
- package.json (defines workspaces for \apps and \packages)
\apps
\someApp
- React 17.0.1 (Dependency)
\otherApp
\packages
\component-library
- React 16.14.0 || 17.0.0 (Peer)
- Storybook (6.1)
- Storybook MUI Add On
\framework
- React 16.14.0 || 17.0.0 (Peer)
Running npm ci
in the React folder installs React 16.14 in the \React\node_modules and 17.0.0 in \React\apps\someApp\node_modules. When trying to run the app we get the expected hook error due to multiple versions being installed. But I can't find anything that is explicitly requiring React 16.14?
packages/component-library
folder, i tried tonpm link ../../node_modules/react
. It threw an error showingnpm ERR! Could not resolve dependency: npm ERR! peer react@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/[email protected]
Looks like storybook requires@react/router
which usesreact 16.14
– Haplite