【发布时间】:2019-03-05 03:01:09
【问题描述】:
我看到的错误是这样的:
我看到了很多关于这个错误的问题,但都是一些不同的上下文。我看到这个错误必须与node_modules 中的名称冲突有关。 不重复
终端中的 MetroBundler:
Loading dependency graph...(node:739) UnhandledPromiseRejectionWarning: Error:
jest-haste-map: @providesModule naming collision:
Duplicate module name: react-native
Paths: /Users/iqubex/Sites/FidoDido/node_modules/react-native/package.json collides with /Users/iqubex/Sites/FidoDido/node_modules/iconic-input/node_modules/react-native/package.json
This error is caused by a @providesModule declaration with the same name across two different files.
at setModule (/Users/iqubex/Sites/FidoDido/node_modules/react-native/node_modules/jest-haste-map/build/index.js:462:17)
at workerReply (/Users/iqubex/Sites/FidoDido/node_modules/react-native/node_modules/jest-haste-map/build/index.js:512:9)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:739) 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:739) [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.
::ffff:127.0.0.1 - - [29/Sep/2018:08:40:16 +0000] "GET /onchange HTTP/1.1" - - "-" "okhttp/3.10.0"
这是我的package.json:
{
"name": "fidodido",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"rnpm": {
"assets": [
"./app/assets/fonts/"
]
},
"dependencies": {
"array-includes": "^3.0.3",
"corejs": "^1.0.0",
"es6-symbol": "^3.1.1",
"firebase": "^5.4.0",
"iconic-input": "^1.0.2",
"native-base": "^2.7.2",
"react": "16.4.1",
"react-native": "^0.57.1",
"react-navigation": "^2.11.2",
"rn-sliding-up-panel": "^1.2.1"
},
"devDependencies": {
"babel-jest": "23.4.2",
"babel-preset-react-native": "^5",
"jest": "23.5.0",
"react-test-renderer": "16.4.1"
},
"jest": {
"preset": "react-native"
}
}
节点版本:v10.8.0
npm 版本:v6.2.0
操作系统:Android(在 Mac 上开发)
我真的不知道周围发生了什么。看起来都坏了,不工作了。 请帮忙!
【问题讨论】:
标签: javascript node.js reactjs react-native node-modules