native.createnavigator factory is not a function

You're combining both React Navigation 4 and React Navigation 5 in your project. It's not valid.

React Navigation 4 packages: react-navigation, react-navigation-stack, react-navigation-drawer etc.

React Navigation 5 packages: @react-navigation/native, @react-navigation/stack, @react-navigation/drawer etc.

Follow the official docs and use the correct version and syntax of the packages https://reactnavigation.org/docs/en/getting-started.html

Basically remove your code in root.js and create stack navigator like here https://reactnavigation.org/docs/en/stack-navigator.html


npm install --save @react-navigation/native

after that re-run

npm install @react-navigation/native

It works for me. I hope, it will work in your case