【发布时间】:2021-12-18 17:30:12
【问题描述】:
我的一个项目突然无法在 Windows 笔记本电脑上编译,而在 Mac 上运行完全相同的代码。我已经阅读了关于提升和添加 nohoist 的信息,这似乎解决了 Apollo 客户端的问题。
"workspaces": {
"packages": [
"packages/*"
],
"nohoist": [
"**/tslib",
"**/tslib/**"
]
}
现在,我不使用工作区,但由于我在 package.json 中使用上面的代码,Yarn 在添加或删除包时要求-W 参数说:
error Running this command will add the dependency to the workspace root rather than
the workspace itself, which might not be what you want - if you really meant it, make it
explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
在我看来,这不是最好的方法。我该怎么办?
【问题讨论】:
标签: javascript react-native apollo yarnpkg hoisting