null 不是对象(评估 'rngesturehandlermodule.direction')

Bru*_*tto 14 react-native react-navigation

我正在创建一个带有 react-native 的登录系统,下载后"react-native-gesture-handler" dependencies: "^ 1.1.0""react-navigation": "^ 3.5.1"开始出现以下消息错误:

null 不是对象(评估 'rngesturehandlermodule.direction')

我试图删除项目并重新修改它,删除并重新安装 node_modules 文件夹并重新安装依赖项,但没有任何效果。

Pra*_*nik 9

我遇到过同样的问题。然后我安装react-navigation&react-native-gesture-handler一步一步如下:

脚步 :

  1. 删除node_modulespackage-lock.json

  2. npm install

  3. npm install --save react-navigation

  4. npm install --save react-native-gesture-handler

  5. react-native link

你可以在这里找到原始答案


Muh*_*gan 7

  1. 从终端停止metro bundlerwith Ctrl+C
  2. 再次运行地铁打包器: npx react-native start
  3. 再次运行构建命令 npx react-native run-android

构建过程可能需要几分钟。


And*_*ter 6

cd进入ios项目的子目录并运行pod install.