Reputation: 530
I want to eject my react-native so I can install mobx but running both 'yarn run eject' and 'npm run eject' doesn't work.i think this is new issue and so couldn't find help online. any help would be appreciated.
this is my package.json file and the error given below.
{
"name": "a2x",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-preset-react-native-stage-0": "^1.0.1",
"jest": "^22.4.4",
"jest-react-native": "^18.0.0",
"react-test-renderer": "16.3.1"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "jest",
"eject": "react-native run-eject"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"axios": "^0.18.0",
"mobx": "^5.5.0",
"mobx-react": "^5.2.8",
"react": "16.3.1",
"react-native": "~0.55.2",
"react-native-elements": "^0.19.1",
"react-navigation": "^2.0.1"
}
}
Upvotes: 1
Views: 3534
Reputation: 97
Always working for me, only follow two steps first install in your project
yarn add react-native-eject
and then run
react-native eject
make sure you have install yarn in your pc
Upvotes: 0
Reputation: 35569
Actual command is react-native eject
.
It will create new folder for android and iOS to run it seperately on native.
As you said you are getting error of Both the iOS and Android folders already exist!
, so please delete it and try with this command.
If you already have android and ios folder with some native implementation, there is no need to use eject
command at all.
regarding npm run reject
command, I guess this will be more useful to clear everything.
Upvotes: 1
Reputation: 115
Try npm run eject
..not npm run-eject
But if you trying to add native dependencies later i think better to start project using react native init
. not using create-react-native-app
.
Upvotes: 1