node.js - React native: Can't run project in iOS mode - Duplicate module name -


i'm trying run react native project in ios mode.

$ react-native run-ios 

but i'm running in errors

failed 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 /users/mobile/node_modules/react-native/libraries/animated/release/package.json  error caused @providesmodule declaration same name across 2 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 /users/mobile/node_modules/react-native/libraries/animated/release/package.json  error caused @providesmodule declaration same name across 2 different files. @ hastemap._updatehastemap (/users/mobile/node_modules/react-native/packager/react-packager/src/node-haste/dependencygraph/hastemap.js:158:13) @ /users/mobile/node_modules/react-native/packager/react-packager/src/node-haste/dependencygraph/hastemap.js:133:31 

i not understand problem , need problem fixed.


this how i've setup system (macos sierra):

$ brew install node $ brew install watchman $ sudo npm install -g react-native-cli $ npm install invariant --save-dev $ npm install 

everything should installed fine:

versions

$ node -v   v4.0.0  $ react-native -v   react-native-cli: 2.0.1   react-native: 0.40.0  $ watchman -v   4.7.0 

package.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 list

$ 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 

clear cache , start project again.

follow these steps clear cache in react native package.

watchman watch-del-all

rm -rf $tmpdir/react-*

rm -rf node_modules/

npm cache clean

npm install

npm start -- --reset-cache


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -