![](/img/trans.png)
[英]I keep getting an" EIO: i/o error: when I use the expo init command
[英]Getting the following error while executing expo init command
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\SAMSUNG\AppData\Roaming\npm-cache\_logs\2019-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.
这似乎是一个core-js
版本问题。
在package.json
,检查"expo-core": "version"
如果它低于错误:您更正版本以适应错误。
和rm -rf node_modules && npm install
或者
npm install -g expo-cli
完成后,尝试运行一个新的expo init
。
默认的expo-template-blank
模板将react-native
指向他们自己的 Github 存储库 - 从 Github 存储库安装可能会导致 NPM 由于各种原因挂起或出错。
要解决此ctrl-c
以在项目脚手架完成后继续安装依赖项时中断初始化,请编辑package.json
以从 NPM 注册表安装react-native
- 例如,这是我的依赖项的外观:
"dependencies": {
"expo": "^35.0.1",
"react": "^16.8.3",
"react-dom": "^16.8.3",
"react-native": "^0.59.10"
//...
然后手动执行npm i
安装依赖项并享受。
这会显示您未安装 git 的情况。 你可以按照上面的任何答案来让它在本地工作。 但是,如果您在部署节点应用程序时遇到此问题,请检查您用于部署的节点映像。 如果它是 node: alpine 那么你会得到这个错误。
要修复它,您可以使用 node:carbon 图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.