Failed to build DependencyGraph

12 篇文章 1 订阅
3 篇文章 0 订阅

Failed to build DependencyGraph: @providesModule naming collision:

错误提示

> demo@0.0.1 start /Users/holoto/WebstormProjects/demo
> node node_modules/react-native/local-cli/cli.js start

 ┌────────────────────────────────────────────────────────────────────────────┐
 │  Running packager on port 8081.                                            │
 │                                                                            │
 │  Keep this packager running while developing on any JS projects. Feel      │
 │  free to close this tab and run your own packager instance if you          │
 │  prefer.                                                                   │
 │                                                                            │
 │  https://github.com/facebook/react-native                                  │
 │                                                                            │
 └────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
   /Users/holoto/WebstormProjects/demo

[3:39:16 PM] <START> Building Dependency Graph
[3:39:16 PM] <START> Crawling File System
[Hot Module Replacement] Server listening on /hot

React packager ready.

[3:39:18 PM] <END>   Crawling File System (1203ms)
[3:39:18 PM] <START> Building in-memory fs for JavaScript
[3:39:18 PM] <END>   Building in-memory fs for JavaScript (223ms)
[3:39:18 PM] <START> Building in-memory fs for Assets
[3:39:18 PM] <END>   Building in-memory fs for Assets (140ms)
[3:39:18 PM] <START> Building Haste Map
[3:39:18 PM] <START> Building (deprecated) Asset Map
[3:39:18 PM] <END>   Building (deprecated) Asset Map (99ms)
Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: String.prototype.es6
  Paths: /Users/holoto/WebstormProjects/demo/node_modules/react-native-router/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/polyfills/String.prototype.es6.js collides with /Users/holoto/WebstormProjects/demo/node_modules/react-native/packager/react-packager/src/Resolver/polyfills/String.prototype.es6.js

This error is caused by a @providesModule declaration with the same name accross two different files.
Error: @providesModule naming collision:
  Duplicate module name: String.prototype.es6
  Paths: /Users/holoto/WebstormProjects/demo/node_modules/react-native-router/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/polyfills/String.prototype.es6.js collides with /Users/holoto/WebstormProjects/demo/node_modules/react-native/packager/react-packager/src/Resolver/polyfills/String.prototype.es6.js

This error is caused by a @providesModule declaration with the same name accross two different files.
    at HasteMap._updateHasteMap (/Users/holoto/WebstormProjects/demo/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:162:15)
    at /Users/holoto/WebstormProjects/demo/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:127:25

npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.2.1
npm ERR! npm  v3.9.3
npm ERR! code ELIFECYCLE
npm ERR! demo@0.0.1 start: `node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demo@0.0.1 start script 'node node_modules/react-native/local-cli/cli.js start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the demo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node node_modules/react-native/local-cli/cli.js start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs demo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls demo
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/holoto/WebstormProjects/demo/npm-debug.log

错误原因

react-native-router自带了一个react-native
在目录node_modules/react-native-router/node_modules/react-native

解决方案

删除react-native-routerreact-native目录

bash在项目目录下执行

rm -R node_modules/react-native-router/node_modules/react-native

参考

https://github.com/facebook/react-native/issues/3558

引用和提到了一个错误信息,即"Failed to build pycocotools"和"ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly"。这是在尝试通过pip install命令安装pycocotools时出现的错误。而引用则指出了造成这个错误的可能原因,即缺少gcc编译器。 Pycocotools是COCO数据集的Python API工具,用于加载、解析和可视化annotations。在Windows系统上,安装pycocotools时可能会遇到编译问题。错误信息指出无法构建pycocotools的wheels,并提到了使用PEP 517的问题。 造成这个错误的原因之一是缺少gcc编译器。gcc是GNU编译器集合中的一种,用于编译C语言程序。在Windows系统上,如果没有正确配置gcc编译器,就无法构建pycocotools的wheels。为了解决这个问题,需要安装Visual C++ Build Tools,可以从microsoft.com/visual-cpp-build-tools/上下载并安装。 总结回答您的问题,"Failed to build pycocotools"错误是在尝试通过pip install命令在Windows上安装pycocotools时出现的。这个错误可能是由于缺少gcc编译器引起的。解决这个问题的方法是安装Visual C++ Build Tools。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Failed to build pycocotoolsERROR: Could not build wheels for pycocotools which use PEP 517 and cann](https://blog.csdn.net/zhangfenger/article/details/129664652)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Windows上安装 pycocotools 失败](https://blog.csdn.net/weixin_46587777/article/details/124562795)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [pycocotools安装报错](https://blog.csdn.net/m0_47026232/article/details/130444906)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值