簡體   English   中英

expo 切換 wsl1 到 wsl2 后無法啟動

[英]expo wont start after switching wsl1 to wsl2

我嘗試運行expo startyarn start並且控制台拋出錯誤。 在 wsl1 上它工作正常,它顯示 QR 碼。 但是,我必須切換到 wsl2 為我的本地服務器設置 mysql,現在 expo 沒有啟動。 有時也會出現二維碼,但是當我嘗試在設備中打開應用程序時,也會出現同樣的錯誤。

Developer tools running on http://localhost:19002
Could not get status from Metro bundler. connect ECONNREFUSED 127.0.0.1:19001
Connecting to Metro bundler failed.
Error: Connecting to Metro bundler failed.
    at _waitForRunningAsync (/home/kevsmercs/.nvm/versions/node/v12.13.0/lib/node_modules/expo-cli/node_modules/xdl/src/start/startLegacyReactNativeServerAsync.ts:344:11)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

我認為這里的問題是 expo 本身。 我嘗試檢查開發人員工具 url,無法訪問該站點。 我還嘗試使用expo login檢查我的帳戶,並出現此錯誤

Fetching the user profile failed
connect ECONNREFUSED 127.0.0.1:8888
connect ECONNREFUSED 127.0.0.1:8888
Error: connect ECONNREFUSED 127.0.0.1:8888
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1128:14)

jest-haste-map:守望者抓取失敗。 使用節點爬蟲重試一次。 這通常發生在守望者不運行時。 在項目的根文件夾中創建一個空的.watchmanconfig文件,或在項目中初始化 git 或 hg 存儲庫。 錯誤:守望者錯誤:查詢失敗:同步失敗:連接超時。 確保 watchman 正在為此項目運行。 請參閱https://facebook.github.io/watchman/docs/troubleshooting.html


I tried multiple fixes but no luck.
 1. set `REACT_NATIVE_PACKAGER_HOSTNAME` to my ip using `export`
 2. delete `.expo` from root of project and run `expo start -c`
 3. turn off windows defender and firewall
 4. update `expo-cli` to latest (4.4.1)
 5. restart laptop

也許這個 GitHub 問題描述了您的問題和解決方法?

這通常發生在發布時沒有運行 expo 啟動,運行 rm -rf.expo 清除本地 state 也是一個好主意

它列在我們的常見開發錯誤中

您的最新編輯顯示此錯誤消息和建議的修復: Usually this happens when watchman isn't running. Create an empty 在項目的根文件夾中Usually this happens when watchman isn't running. Create an empty .watchmanconfig file in your project's root folder or initialize a git or hg repository in your project. 你試過嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM