我试图在iOS模式下运行一个react本机项目。
$ react-native run-ios但我在错误中运行
Failed to build DependencyGraph: @providesModule naming collision:
Duplicate module name: react-animated
Paths: /Users/mobile/node_modules/react-native-image-carousel/node_modules/react-native/Libraries/Animated/release/package.json collides with /Users/mobile/node_modules/react-native/Libraries/Animated/release/package.json
This error is caused by a @providesModule declaration with the same name across two different files.
Error: @providesModule naming collision:
Duplicate module name: react-animated
Paths: /Users/mobile/node_modules/react-native-image-carousel/node_modules/react-native/Libraries/Animated/release/package.json collides with /Users/mobile/node_modules/react-native/Libraries/Animated/release/package.json
This error is caused by a @providesModule declaration with the same name across two different files.
at HasteMap._updateHasteMap (/Users/mobile/node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:158:13)
at /Users/mobile/node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:133:31我不明白这个问题,真的需要一些帮助来解决问题。
这就是我如何设置我的系统(macOS塞拉利昂):
$ brew install node
$ brew install watchman
$ sudo npm install -g react-native-cli
$ npm install invariant --save-dev
$ npm install所有的安装都应该很好:
版本
$ node -v
v4.0.0
$ react-native -v
react-native-cli: 2.0.1
react-native: 0.40.0
$ watchman -v
4.7.0package.json
{
"dependencies": {
"react": "~15.4.0-rc.4",
"react-native": "0.40.0",
"react-native-image-carousel": "^0.3.2",
"react-native-image-picker": "^0.25.7",
"react-native-local-mongodb": "^1.8.2"
},
"devDependencies": {
"babel-jest": "18.0.0",
"babel-preset-react-native": "1.9.1",
"invariant": "^2.2.2",
"jest": "18.1.0",
"react-test-renderer": "~15.4.0-rc.4"
},
"jest": {
"preset": "react-native"
}
}npm列表
$ npm list --depth=0
├── babel-jest@18.0.0
├── babel-preset-react-native@1.9.1
├── invariant@2.2.2
├── jest@18.1.0
├── react@15.4.2
├── react-native@0.40.0
├── react-native-image-carousel@0.3.2
├── react-native-image-picker@0.25.7
├── react-native-local-mongodb@1.8.2
└── react-test-renderer@15.4.2发布于 2017-08-18 15:54:22
清除缓存并再次启动项目。
按照以下步骤清除您的中的缓存。
watchman watch-del-all
rm -rf $TMPDIR/react-*
rm -rf node_modules/
npm cache clean
npm install
npm start -- --reset-cache
https://stackoverflow.com/questions/45758203
复制相似问题