项目初始化问题
来源:5-1 项目初始化

超人小彬
2020-05-16
使用了 react-native init book --template typescript 这个命令初始化项目,多了一个template文件夹,之后运行npm run ios
出现了这个错误
jest-haste-map: Haste module naming collision: book
The following files share their name; please adjust your hasteImpl:
* /template/package.json
* /package.json
Failed to construct transformer: DuplicateError: Duplicated files or mocks. Please check the console for more info
at setModule (/Users/apple/Documents/project/reactnative/book/node_modules/metro/node_modules/jest-haste-map/build/index.js:620:17)
at workerReply (/Users/apple/Documents/project/reactnative/book/node_modules/metro/node_modules/jest-haste-map/build/index.js:691:9)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Promise.all (index 21522) {
mockPath1: ‘template/package.json’,
mockPath2: ‘package.json’
}
2回答
-
weixin_慕工程5385781
2020-12-03
请问解决了吗,我也遇到这个问题了
012021-06-30 -
今朝
2020-05-16
这个应该还是因为你没删除全局的react-native-cli命令导致的
00
相似问题