react-native - 如何修复反应原生博览会起始代码?
问题描述
当我输入正常的 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.
解决方案
我搜索了错误并找到了解决方案。
我通过参考链接得出了答案。
我能够通过首先安装 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
如果您还有其他问题,请发表评论。
推荐阅读
- python-3.x - 相对导入兼容性问题 py2 和 py3
- swift - swift - 如何在屏幕上的 2 个不同列中打印到控制台多行字符串
- angular - 带孩子的角度路由器模块
- javascript - 当日期为空时,如何在日期输入字段中显示设置为“mm/dd/yyyy”而不是“1/1/0001”的占位符?
- java - 访问 JavaFx TableView / TableColumn 中的嵌套属性
- python - 为什么 SQLITE 不接受使用 Python 3 的大于 8 的我的 INTEGER/TEXT 数据?
- angular - 无法通过 AWS EC2 实例上的公共 DNS 访问正在运行的 docker 容器
- wordpress - 重力形式数据存储在哪里?
- wordpress - 从我的 PC 将插件文件夹上传到谷歌计算引擎 VM 实例中的 wordpress 目录
- r - 如何标记与主题相关的每个文档