run expo update / nmp update first,
then, Install packages:
npm install @react-navigation/native
Installing dependencies into an Expo managed project:
expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
if you are using 'stack' and 'drawer', import the packages as well:
npm install @react-navigation/stack
npm install @react-navigation/drawer
for material bottom and top tabs navigator, import following:
npm install @react-navigation/material-bottom-tabs react-native-paper
npm install @react-navigation/material-top-tabs react-native-tab-view
If you're on a Mac and developing for iOS, you need to install the pods (via Cocoapods) to complete the linking.
npx pod-install ios