首页 > 解决方案 > 如何修复反应原生博览会起始代码?

问题描述

当我输入正常的 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://git@github.com/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.

标签: react-nativemobileexpo

解决方案


我搜索了错误并找到了解决方案。

我通过参考链接得出了答案。

我能够通过首先安装 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

如果您还有其他问题,请发表评论。


推荐阅读