Unable to resolve module `@babel/runtime/helpers/interopRequireDefault`

前端 未结 7 1896
无人及你
无人及你 2020-12-15 02:30

When creating a new react native project using the standard react-native init MyApp and running react-native run-ios for the first time I\'m seeing

相关标签:
7条回答
  • 2020-12-15 02:46

    I have face same problem because of incorrect arrangement of createStackNavigator, createAppContainer, createSwitchNavigator in react-native routes

    0 讨论(0)
  • 2020-12-15 02:46

    You should add and install babel for your projects

    npm add @babel/runtime
    npm install
    

    If The error is not fixed, Try:

    npm start --reset-cache
    
    0 讨论(0)
  • 2020-12-15 02:50

    Current error message suggests these steps to fix this:

    1. Clear watchman watches: watchman watch-del-all
    2. Delete node_modules: rm -rf node_modules and run yarn install
    3. Reset Metro's cache: yarn start --reset-cache
    4. Remove the cache: rm -rf /tmp/metro-*

    The last one solved it for me.

    0 讨论(0)
  • 2020-12-15 03:00

    Have a go and try:

    npm add @babel/runtime

    Or upgrade babel runtime:

    "@babel/runtime": "7.0.0-beta.55"

    0 讨论(0)
  • 2020-12-15 03:06

    You should first quit the metro terminal before executing

    npm add @babel/runtime
    npm install
    
    0 讨论(0)
  • 2020-12-15 03:09

    Try to update your npm version first

    npm update -g npm@version or sudo npm -gf update npm@version

    and then just add the babel runtime at your react native project

    npm add @babel/runtime

    0 讨论(0)
提交回复
热议问题