![](/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.