以下问题的解决方法是什么?

时间:2019-04-04 19:07:01

标签: react-native

我正在尝试创建一个新的React-Native项目,但出现了以下错误堆栈跟踪:

C:\Users\MY HP\Desktop\MyProjects\ReactNative\project01>expo init RunAtleast
? Choose a template: expo-template-blank
√ 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 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\MY HP\AppData\Roaming\npm-cache\_logs\2019-04-04T18_59_55_657Z-debug.log
Process exited with non-zero code: 1
Set EXPO_DEBUG=true in your env to view the stack trace.

有人对如何解决此错误有任何想法吗?任何帮助将不胜感激!

2 个答案:

答案 0 :(得分:0)

问题似乎出在Windows下安装git。快速搜索打开了此链接:https://github.com/amplience/cms-javascript-sdk/issues/1

也许您可以在这里的讨论之后找到更多的解决方案?

答案 1 :(得分:0)

已解决,因为我使用了npm cache clear --force并重新安装了npm install -g expo-cli。并解决了问题。.感谢stackovelflow社区提供的此类帮助。