Open nvthuong1996 opened 3 years ago
@nvthuong1996 have you tried adding resolutions
to both of your package.json files?
// landingpage/package.json
{
"name": "landingpage",
// ...
"resolutions": {
"react": "17.0.0" // <- specific required version
}
}
// webapp/package.json
{
"name": "webapp",
// ...
"resolutions": {
"react": "16.0.0" // <- specific required version
}
}
i allready try but it not working. please try at https://github.com/nvthuong1996/test-yarn-workspace and compare react version
rootProject/packages/webapp/node_modules/antd/react
vs
rootProject/packages/webapp/node_modules/react
rootProject/packages/web/node_modules/antd/react
vs
rootProject/packages/web/node_modules/react
I am facing a similar problem. I removed the ^
in the dependency version in package.json (from "^16.9.0"
to "16.9.0"
) and that solved problem for me.
I had a yarn.lock inside each individual workspace, but no yarn.lock in the project root. It appears that yarn ignores the inside yarn.locks. In my usecase, I am creating a mono repo of existing repositories. I think yarn should also check the inside workspace yarn.lock files to install the correct version of the package and build the root yarn.lock according to that.
any progress? faced the same problem as described above
I has two package in mono project use yarn workspace package1: landingpage package2: webapp
Dependency:
I use nohoist
When i run
yarn
to install package landingpage install react@17 but i found react@16 in ant package:Landingpage use react@16 and react@17 => error
Please help me !!