开发服务器返回错误代码500

时间:2020-02-11 21:33:18

标签: react-native

我想运行反应导航。 它给我这个错误的手势处理程序。当我要安装手势处理程序时,发生以下错误。 请给我适当的解决方案。

C:\Users\Farooq\FirstActivity>npm install --save react-native-gesture-handler
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/naver/hammer.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Farooq\AppData\Roaming\npm-cache\_logs\2020-02-11T21_17_29_196Z-debug.log

1 个答案:

答案 0 :(得分:0)

这是Windows环境中的典型问题。

  • 首先从here下载Windows的git

然后按照以下步骤

  1. 打开环境变量

  2. 编辑路径

  3. 找到已在设备中安装的git位置。例子是C:\Program Files\Git\cmd

  4. 将git位置添加到路径(确保同时将其添加到用户变量系统变量

  5. 应用更改并重新启动计算机

  6. 最后,返回您的项目并运行npm install react-native-gesture-handler