我想按照本教程(https://facebook.github.io/react-native/docs/getting-started.html)开始学习本机语言。
我遵循了第一步,在命令行上遇到了一些问题: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:\Users\acer\AppData\Roaming\npm-cache\_logs\2019-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.
''''
答案 0 :(得分:0)
安装git跟随链接: https://www.linode.com/docs/development/version-control/how-to-install-git-on-linux-mac-and-windows/ 如果仍然无法正常运行,请运行cmd npm缓存清理--force