我想运行反应导航。 它给我这个错误的手势处理程序。当我要安装手势处理程序时,发生以下错误。 请给我适当的解决方案。
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
答案 0 :(得分:0)
这是Windows环境中的典型问题。
然后按照以下步骤
打开环境变量
编辑路径
找到已在设备中安装的git位置。例子是C:\Program Files\Git\cmd
将git位置添加到路径(确保同时将其添加到用户变量和系统变量)
应用更改并重新启动计算机
最后,返回您的项目并运行npm install react-native-gesture-handler