首页 > 解决方案 > 开发服务器返回错误码 500

问题描述

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

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

标签: react-native

解决方案


这是 windows 环境的典型问题。

然后按照以下步骤

  1. 打开你的环境变量

  2. 编辑路径

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

  4. 将 git 位置添加到Path(确保将其添加到用户变量系统变量

  5. 应用更改并重新启动您的电脑

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


推荐阅读