Unable to resolve “@react-navigation/native” from “App.js” - React Native + How to Solve?

前端 未结 4 534
轻奢々
轻奢々 2021-02-08 16:28

undefined Unable to resolve module @react-navigation/native from App.js: @react-navigation/native could not be found within the project.

If you

相关标签:
4条回答
  • 2021-02-08 17:22

    This error occurs because you haven't installed react-navigation.

    Run:

    npm install react-navigation
    npm start -- --reset-cache
    
    0 讨论(0)
  • 2021-02-08 17:25
    npm install @react-navigation/native
    

    if using expo:

    expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
    

    Also run:

    npm install react-navigation
    
    0 讨论(0)
  • 2021-02-08 17:30

    the best solution is to delete your node_modules and package-lock.json and try npm install, it works for me

    0 讨论(0)
  • 2021-02-08 17:34

    well i have solved this by reinstalling / updating these packages.

    npm install --save react-native-gesture-handler react-native-reanimated react-native-screens
    

    do the trick for

    npm start -- --reset-cache

    But performing the following did succeed:

    Delete

    node_modules & package-lock.json Delete app from phone

    run npm start -- --reset-cache
    run app
    
    0 讨论(0)
提交回复
热议问题