gpt4 book ai didi

javascript - 如何修复 React Native 错误 "jest-haste-map: Haste module naming collision"?

转载 作者:搜寻专家 更新时间:2023-10-31 23:56:50 25 4
gpt4 key购买 nike

当我安装 react-native-popup-menu 时,我遇到了这样的错误。

这是错误代码

Looking for JS files in
E:\react-native\.............\

Loading dependency graph...(node:9460) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision: Duplicate module name: react-native Paths: E:\react-native\.............\node_modules\react-native-twitter-signin\node_modules\react-native\package.json collides with E:\react-native\.............\node_modules\react-native\package.json

This error is caused by hasteImpl returning the same name for different files. at setModule (E:\react-native\.............\node_modules\jest-haste-map\build\index.js:551:17) at workerReply (E:\react-native\.............\node_modules\jest-haste-map\build\index.js:613:9) at process._tickCallback (internal/process/next_tick.js:68:7) (node:9460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:9460) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:9460) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision: Duplicate module name: react-native Paths: E:\react-native\.............\node_modules\react-native-twitter-signin\node_modules\react-native\package.json collides with E:\react-native\.............\heybuddy\node_modules\react-native\package.json

This error is caused by hasteImpl returning the same name for different files. at setModule (E:\react-native\.............\node_modules\jest-haste-map\build\index.js:551:17) at workerReply (E:\react-native\.............\node_modules\jest-haste-map\build\index.js:613:9) at process._tickCallback (internal/process/next_tick.js:68:7) (node:9460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)

我试图找到解决这个错误的方法,但找不到任何解决方案。

最佳答案

我通过在文件夹的根目录中创建一个 metro.config.js 文件解决了这个问题:

module.exports = {
resolver: {
blacklistRE: /#current-cloud-backend\/.*/,
},
};

关于javascript - 如何修复 React Native 错误 "jest-haste-map: Haste module naming collision"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54408307/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com