我在DuplicatePackageChecker monorepo的一个工作区中使用yarn workspaces,它报告了多个core-js版本:
core-js
Multiple versions of core-js found:
2.6.11 /c/dss/Product/Horizon/horizon/~/core-js from /c/dss/Product/Horizon/horizon/~/core-js/modules/_ctx.js
3.6.4 /c/dss/Product/Horizon/horizon/~/@vue/babel-preset-app/~/core-js from /c/dss/Product/Horizon/horizon/~/@vue/babel-preset-app/~/core-js/modules/es.promise.js
我不知道该怎么解释。 ~
符号代表什么?
使用yarn why core-js
,我会得到更加难以理解的输出:
=> Found "core-js@2.6.11"
info Has been hoisted to "core-js"
info Reasons this module exists
- "workspace-aggregator-a432afc4-a6a2-4251-820a-6ce830aa305c" depends on it
- Hoisted from "_project_#front-end#fetch-mock#babel-runtime#core-js"
- Hoisted from "_project_#front-end#@vue#cli-plugin-babel#@vue#babel-preset-app#core-js"
- Hoisted from "_project_#front-end#@vue#cli-plugin-babel#@vue#babel-preset-app#@babel#runtime-corejs2#core-js"
=> Found "front-end#core-js@3.6.4"
info This module exists because "_project_#front-end" depends on it.
... and more similar v3 lines ...
所以最终我的问题是:我应该从哪里着手,以摆脱2.6.11版本?