如何解决React Native错误"jest-haste-map:Haste模块命名冲突"? [英] How to fix React Native error "jest-haste-map: Haste module naming collision"?
问题描述
当我安装react-native-popup-menu时,我遇到了这样的错误.
When I installed react-native-popup-menu, I faced such error.
这是错误代码
在
中查找JS文件 E:\ react-native \ ............. \
Looking for JS files in
E:\react-native\.............\
正在加载依赖关系图...(节点:9460) UnhandledPromiseRejectionWarning:错误:jest-haste-map:加速模块 命名冲突:重复的模块名称:react-native路径: E:\ react-native \ ............. \ node_modules \ react-native-twitter-signin \ node_modules \ react-native \ package.json 与…相撞 E:\ react-native \ ............. \ node_modules \ react-native \ package.json
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
此错误是由hasteImpl
返回相同的名称引起的
不同的文件.
在setModule(E:\ react-native \ .............. \ node_modules \ jest-haste-map \ build \ index.js:551:17)
在workerReply(E:\ react-native \ .............. \ node_modules \ jest-haste-map \ build \ index.js:613:9)
在process._tickCallback(内部/进程/next_tick.js:68:7)(节点:9460)处UnhandledPromiseRejectionWarning:未处理的承诺
拒绝.此错误是由抛出异步内部引起的
没有捕获块的功能,或者通过拒绝原先的承诺
未使用.catch()处理. (拒绝ID:2)(节点:9460)[DEP0018]
DeprecationWarning:已弃用未处理的承诺拒绝.在
未来,未处理的承诺拒绝将终止
使用非零退出代码的Node.js进程. (节点:9460)
UnhandledPromiseRejectionWarning:错误:jest-haste-map:加速模块
命名冲突:重复的模块名称:react-native路径:
E:\ react-native \ ............. \ node_modules \ react-native-twitter-signin \ node_modules \ react-native \ package.json
与…相撞
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: 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
此错误是由hasteImpl
返回相同的名称引起的
不同的文件.
在setModule(E:\ react-native \ .............. \ node_modules \ jest-haste-map \ build \ index.js:551:17)
在workerReply(E:\ react-native \ .............. \ node_modules \ jest-haste-map \ build \ index.js:613:9)
在process._tickCallback(内部/进程/next_tick.js:68:7)(节点:9460)处UnhandledPromiseRejectionWarning:未处理的承诺
拒绝.此错误是由抛出异步内部引起的
没有捕获块的功能,或者通过拒绝原先的承诺
未使用.catch()处理. (拒绝ID:3)
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)
我试图找到解决此错误的方法,但找不到任何解决方案.
I tried to find the way to solve this error, but I can't find any solution.
推荐答案
我遇到了这个问题,我创建了源文件的备份并删除了所有内容,即整个文件夹.仅仅删除node_modules是不够的.取回文件并使用npm install软件包后,它就可以了.
I had this problem and I created a backup of the source files and deleted everything, the whole folder. Deleting node_modules wasn't enough. After getting the files back and using npm install for the packages, it worked.
这篇关于如何解决React Native错误"jest-haste-map:Haste模块命名冲突"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!