Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs React-Native:错误:jest-haste映射:haste模块命名冲突,重复模块名称:React-animated_Reactjs_React Native_Storybook - Fatal编程技术网

Reactjs React-Native:错误:jest-haste映射:haste模块命名冲突,重复模块名称:React-animated

Reactjs React-Native:错误:jest-haste映射:haste模块命名冲突,重复模块名称:React-animated,reactjs,react-native,storybook,Reactjs,React Native,Storybook,我有两个模块 反应本机应用程序 反应本土故事书 local.properties放置您的android sdk路径 运行npm start时出现以下错误 Looking for JS files in /home/company/Desktop/projects/someapp/vendorapp Loading dependency graph...(node:9505) UnhandledPromiseRejectionWarning: Error: jest-haste-ma

我有两个模块

  • 反应本机应用程序
  • 反应本土故事书
local.properties放置您的android sdk路径

运行npm start时出现以下错误

Looking for JS files in
   /home/company/Desktop/projects/someapp/vendorapp 

Loading dependency graph...(node:9505) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision:
  Duplicate module name: react-animated
  Paths: /home/company/Desktop/projects/someapp/vendorapp/node_modules/storybook/node_modules/react-native/Libraries/Animated/release/package.json collides with /home/company/Desktop/projects/someapp/vendorapp/node_modules/react-native/Libraries/Animated/release/package.json

This error is caused by `hasteImpl` returning the same name for different files.
    at setModule (/home/company/Desktop/projects/someapp/vendorapp/node_modules/metro/node_modules/jest-haste-map/build/index.js:569:17)
    at workerReply (/home/company/Desktop/projects/someapp/vendorapp/node_modules/metro/node_modules/jest-haste-map/build/index.js:641:9)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:9505) 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:9505) [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:9505) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision:
  Duplicate module name: react-animated
  Paths: /home/company/Desktop/projects/someapp/vendorapp/node_modules/storybook/node_modules/react-native/Libraries/Animated/release/package.json collides with /home/company/Desktop/projects/someapp/vendorapp/node_modules/react-native/Libraries/Animated/release/package.json

This error is caused by `hasteImpl` returning the same name for different files.
    at setModule (/home/company/Desktop/projects/someapp/vendorapp/node_modules/metro/node_modules/jest-haste-map/build/index.js:569:17)
    at workerReply (/home/company/Desktop/projects/someapp/vendorapp/node_modules/metro/node_modules/jest-haste-map/build/index.js:641:9)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:9505) 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)
反应本机应用程序

{
  "name": "vendorapp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.6.3",
    "react-native": "0.58.3",
    "react-redux": "^6.0.0",
    "redux": "^4.0.1",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "storybook": "../storybook"
  },
  "devDependencies": {
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "24.0.0",
    "jest": "24.0.0",
    "metro-react-native-babel-preset": "0.51.1",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

你曾经解决过这个问题吗?删除了storybook中的节点模块,并在移动应用程序中安装了npm。。。这对我有用@Daniel
{
  "name": "vendorapp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.6.3",
    "react-native": "0.58.3",
    "react-redux": "^6.0.0",
    "redux": "^4.0.1",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "storybook": "../storybook"
  },
  "devDependencies": {
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "24.0.0",
    "jest": "24.0.0",
    "metro-react-native-babel-preset": "0.51.1",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  }
}