首页 > 解决方案 > 为什么反应导航不能在反应原生中工作?

问题描述

我尝试了“npm install --save react-navigation”并得到了一堆错误:npm ERR!代码 ENOENT npm 错误!系统调用重命名 npm ERR!路径 C:\Users\hoppe\rn-meal-app\node_modules@react-navigation\core\node_modules\hoist-non-react-statics npm ERR!dest C:\Users\hoppe\rn-meal-app\node_modules@react-navigation\core\node_modules.hoist-non-react-statics.DELETE npm ERR!errno -4058 npm 错误!enoent ENOENT:没有这样的文件或目录,重命名 'C:\Users\hoppe\rn-meal-app\node_modules@react-navigation\core\node_modules\hoist-non-react-statics' -> 'C:\Users\ hoppe\rn-meal-app\node_modules@react-navigation\core\node_modules.hoist-non-react-statics.DELETE' npm 错误!enoent 这与 npm 找不到文件有关。npm 错误!恩恩

npm 错误!可以在以下位置找到此运行的完整日志:npm ERR!C:\Users\hoppe\AppData\Roaming\npm-cache_logs\2020-08-30T02_38_23_800Z-debug.log

标签: react-native

解决方案


对于安装 --react-navigation-- 您需要安装一些包依赖项,例如:

  • react-native-reanimated
  • 反应本机手势处理程序
  • 反应原生屏幕
  • 反应原生安全区域上下文
  • @react-native-community/masked-view

你可以用这个安装它:

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

更多阅读请参见链接


推荐阅读