如何弄清楚为什么在Yarn3 Monorepo中不悬挂包装?

发布于 2025-01-29 20:59:38 字数 734 浏览 3 评论 0原文

我正在使用纱3 monorepo,由于某些原因,react> react-dom软件包未正确悬挂: 相同版本的react-dom在包装之间重复。

qnm react-dom
react-dom 18.1.0 ↰ 18 hours ago
├── 16.14.0 ⇡ 1 year ago
└─┬ package-a
  └── 16.14.0 ⇡ 1 year ago

我在root软件包中有下一个决议

  "resolutions": {
    "react": "^16.14.0",
    "react-dom": "^16.14.0",
    ...
  }

。 似乎一切都是react的正确且引起的版本

npm info [email protected] peerDependencies
{ react: '^16.14.0' }

但是, ,这无济于事。

您能否建议使用YARN 3进行任何工具或方法如何调试为什么不悬挂软件包?

I'm using yarn 3 monorepo and for some reason, react-dom package is not hoisted properly:
The same version of react-dom is duplicated across packanges.

qnm react-dom
react-dom 18.1.0 ↰ 18 hours ago
├── 16.14.0 ⇡ 1 year ago
└─┬ package-a
  └── 16.14.0 ⇡ 1 year ago

I have the next resolutions in root package.json

  "resolutions": {
    "react": "^16.14.0",
    "react-dom": "^16.14.0",
    ...
  }

I read that package could be prevented from hoisting because of wrong peer dependencies,
but seems that everything is a correct and hoisted version of react is meeting the peer dependency requirement of react-dom:

npm info [email protected] peerDependencies
{ react: '^16.14.0' }

Also, I've trying to do yarn dedupe and it's not helping.

Can you suggest any tool or approach how to debug why a package is not hoisted, with yarn 3?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文