小编mur*_*mzk的帖子

React Native DuplicateError:重复的文件或模拟

更新 xCode 后,我在一周内面临以下错误。我无法在设备上运行应用程序。我不认为问题出在 xcode 上,因为即使我尝试在 android 设备上运行也会出现同样的问题。

当我们使用重置选项运行 npm start 时会出现问题,也会发生相同的错误。

唯一的选择是在删除 ios build 文件夹后在 android 设备上运行。

错误

The following files share their name; please adjust your hasteImpl:
    * <rootDir>/node_modules/react-native/package.json
    * <rootDir>/ios/build/oleo/Build/Products/Debug-iphoneos/oleo.app/assets/node_modules/react-native/package.json

Failed to construct transformer:  DuplicateError: Duplicated files or mocks. Please check the console for more info
    at setModule (/Users/murtazakanpurwala/Documents/Work/Web_Design_Dev/Clients/Oleo/OleoCW/node_modules/jest-haste-map/build/index.js:620:17)
    at workerReply (/Users/murtazakanpurwala/Documents/Work/Web_Design_Dev/Clients/Oleo/OleoCW/node_modules/jest-haste-map/build/index.js:691:9)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 668) {
  mockPath1: 'node_modules/react-native/package.json',
  mockPath2: 'ios/build/oleo/Build/Products/Debug-iphoneos/oleo.app/assets/node_modules/react-native/package.json'
}
(node:8630) UnhandledPromiseRejectionWarning: Error: Duplicated files or mocks. Please check the console for …
Run Code Online (Sandbox Code Playgroud)

javascript ios jestjs react-native

6
推荐指数
3
解决办法
6512
查看次数

标签 统计

ios ×1

javascript ×1

jestjs ×1

react-native ×1