在Monorepo中设置react-native时出现捆绑错误

时间:2019-10-09 13:52:57

标签: react-native yarn monorepo yarn-workspaces metro-bundler

我在使用工作区的纱线monorepo内设置新的本机项目时遇到一些问题。我的根package.json看起来像:

{
  "name": "mono-repo",
  "workspaces": {
    "packages": [
      "web-app",
      "utils",
      "mobile-app"
    ],
    "nohoist": [
      "**/jest",
      "**/jest/**",
      "**/mocha",
      "**/mocha/**",
      "**/react-native",
      "**/react-native/**"
    ]
  },

当我运行yarn run-ios时,构建成功,但出现捆绑错误:

bundling failed: Error: Unable to resolve module `bugsnag-react-native` from `index.js`: bugsnag-react-native could not be found within the project or in these directories:
  ../node_modules

bugsnag-react-native文件夹确实位于根node_modules

有人知道这里可能发生什么/如何解决吗?

我正在使用纱线版本1.19.0

0 个答案:

没有答案