当我键入正常的expo代码并启动我的项目时,我收到以下错误:
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://[email protected]/expo/react-native-maps.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\Atharva Sawant\AppData\Roaming\npm-cache\_logs\2019-03-27T17_07_14_954Z-debug.log
Process exited with non-zero code: 1
Set EXPO_DEBUG=true in your env to view the stack trace.
我搜索错误并找到了解决方案。
我通过引用the link.得出答案
我能够通过首先安装Git for Windows来实现它,如前面提到的https://git-for-windows.github.io/。
然后,不要打开常规命令提示符并发出apm install命令,而是转到Windows开始菜单并打开Git CMD。在那里运行命令,它应该工作。
要么
你尝试将GIT添加到$ PATH
如果您不能使用Set,请尝试使用Setx添加它。
语法示例是:
setx PATH "%PATH%;C:\Program Files\MySQL\MySQL Server 5.5\bin" /M
如果您还有其他问题,请发表评论。