react-native 安装 react-native-gesture-handler 只是动手而不安装

react-native installing react-native-gesture-handler just hands and doesn't install

我正在尝试安装 react-navigation,这样我就可以将导航添加到我的 React 应用程序中。我正在按照 https://facebook.github.io/react-native/docs/navigation 上的说明进行操作,但我无法正确安装它。

我在 windows 机器上并且有 React 版本

我安装了 react-native

npm install -g react-native

我安装了cli

npm install -g --save react-native-cli

我创建了我的应用程序

react-native init MyReactNativeApp

我已进入该文件夹

cd MyReactNativeApp

我安装了反应导航

npm install -g --save react-navigation
npm install @react-navigation/native @react-navigation/stack

我正在尝试 运行 下一步,但它只是挂起

If you have an bare React Native project, install the dependencies with npm:

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

进一步调查显示我可以安装以下所有东西都可以

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

它只是挂起的 "react-native-gesture-handler" 安装,我没有收到任何错误消息

npm --save install react-native-gesture-handler
[..................] - loadDep:prop-types: sill resolveWithNewModule react-native-gesture-handler@1.5.6 checking installable status

我已经在网上搜索并尝试了很多方法,例如下面的那些,但没有任何效果

我相信如果没有这个我就不能使用 react-navigation 并且我的应用程序无法 运行。

我不明白为什么当我按照官方文档进行操作时这不起作用。

更新

最终它失败了(大约 10 分钟后)

npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t 
https://github.com/naver/hammer.js.git
npm ERR!
npm ERR! undefined
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\MYUSER\AppData\Roaming\npm-cache\_logs20-02- 
12T13_26_03_301Z-debug.log

日志文件内容除了错误什么都没说

43 error Error while executing:
43 error C:\Program Files\Git\cmd\git.EXE ls-remote -h -t 
https://github.com/naver/hammer.js.git
43 error
43 error undefined
43 error exited with error code: 128

GIT 在我的机器上

 >which git
 C:\Program Files\Git\cmd\git.EXE

 >git --version
 git version 2.21.0.windows.1
  1. 确认您有 git 安装程序并且可以在命令行中使用
  2. 由于您使用的是 rn 61,因此您应该使用 npx 初始化您的项目

npx react-native init AwesomeProject

错误暗示 GIT 无法访问给定的站点。我在公司防火墙后面。我在 git 中设置了代理,现在我可以安装 "react-native-gesture-handler"

 git config --global http.proxy http://host:port