执行 expo init 命令时出现以下错误 [英] Getting the following error while executing expo init command

查看:43
本文介绍了执行 expo init 命令时出现以下错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Installing dependencies...
npm WARN deprecated core-js@1.2.7: core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
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:UsersSAMSUNGAppDataRoaming
pm-cache\_logs2019-04-01T08_16_06_470Z-debug.log
Process exited with non-zero code: 1
Set EXPO_DEBUG=true in your env to view the stack trace.

推荐答案

请确保您拥有 git 安装.NPM 需要 git 来安装一些软件包.您可以通过以下方式检查 git 是否已安装:

Please make sure, that you have git installed. NPM requires git for installing some of the packages. You can check if git is installed via:

git --version

如果是这样,根据报告的问题,删除并重新安装 node_modules应该有帮助:

If so, according to the reported issue, removing and reinstalling node_modules should help:

rm -rf node_modules && npm install

您也可以尝试使用yarn:

brew install yarn
npm uninstall -g create-react-native-app
yarn global add create-react-native-app

这篇关于执行 expo init 命令时出现以下错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆