Search code examples
react-nativecreate-react-app

Not able to eject again after eject react native


I am new to reactnative, I have successfully eject to a native build, and I found some thing to tweak after reactnative so I want to edit the js again and eject again.

But I found it not able to eject using npm run eject again and it shows the following error:

npm run eject
npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "eject"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10

npm ERR! missing script: eject
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/xxx/work/reactnative/maoquote/npm-debug.log

And I checked the package.json in the project folder, and the eject block was missing, but I am sure that the eject block was there before I first ejection the project, seems the framework has removed it after ejection?

Don't know why reactnative not allow me to eject again, is there any way I could do that?

I am using reactnative version 0.45

thanks !


Solution

  • You created the project using create-react-native-app ? Unfortunately, ejecting is not reversible, you should use your version control to manual roll back.

    See Ejecting:

    "Ejecting" is the process of setting up your own custom builds for your CRNA app. It can be necessary to do if you have needs that aren't covered by CRNA, but please note that aside from the use of version control systems (git, hg, etc.) it is not reversible.