简体   繁体   English

使用 bit.dev 和 react-native env,构建出错

[英]Using bit.dev and react-native env, the build is giving error

I created two components in react-native, they are working fine in my dev environment, when I use bit compile and bit status, everything remains on track, no errors.我在 react-native 中创建了两个组件,它们在我的开发环境中运行良好,当我使用位编译和位状态时,一切都保持正常,没有错误。 But when i use bit build or bit tag, it starts giving me error Validation Error: Preset react-native not found.但是当我使用位构建或位标记时,它开始给我错误Validation Error: Preset react-native not found.

To counter this, I have added a new env extension that is using react-native and my components are using the env extension.为了解决这个问题,我添加了一个使用 react-native 的新 env 扩展,并且我的组件正在使用 env 扩展。 I have overrided the jest config and added preset there.我已经覆盖了开玩笑的配置并在那里添加了预设。 Nothing works.没有任何效果。 Any solution to this?有什么解决办法吗?

I have also confirmed that components are using the env extension only.我还确认组件仅使用 env 扩展。 configured tester: teambit.defender/jest (Jest @ 27.5.1) I tried overriding this jest version, which I was unable to.配置的测试人员:teambit.defender/jest (Jest @ 27.5.1) 我尝试覆盖这个 jest 版本,但我无法做到。

I got the solution, for this we have to add react-native as dev-dependecies in workspace.jsonc file.我得到了解决方案,为此我们必须在 workspace.jsonc 文件中添加 react-native 作为 dev-dependecies。 Bit does't pick from the package.json. Bit 不会从 package.json 中挑选。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM