执行"expo init"命令时出现以下错误



我想按照本教程(https://facebook.github.io/react-native/docs/getting-started.html(开始学习react-native。

我按照第一步操作,在命令行上遇到了一些问题:expo init AwesomeProject

这是日志:

'

''

? Choose a template: expo-template-tabs
√ Please enter a few initial configuration values.
  Read more: https://docs.expo.io/versions/latest/workflow/configuration/ · 100% completed
Extracting project files...
Customizing project...
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 WARN deprecated kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0> for migration path(s).
[  ................] / fetchMetadata: sill pacote range manifest for copy-descriptor@^0.1.0 f[ 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:UsersacerAppDataRoamingnpm-cache_logs2019-04-08T15_58_42_285Z-debug.log
Process exited with non-zero code: 1
Set EXPO_DEBUG=true in your env to view the stack trace.
''''

安装 git 以下链接:https://www.linode.com/docs/development/version-control/how-to-install-git-on-linux-mac-and-windows/如果仍然不起作用,请运行cmd npm 缓存清理 --强制

最新更新