【问题标题】:expo wont start after switching wsl1 to wsl2将 wsl1 切换到 wsl2 后,expo 不会启动
【发布时间】:2021-07-11 01:34:49
【问题描述】:

我尝试运行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 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:守望者抓取失败。使用节点爬虫重试一次。这通常发生在 watchman 不运行时。在项目的根文件夹中创建一个空的 .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

【问题讨论】:

    标签: expo windows-subsystem-for-linux wsl-2


    【解决方案1】:

    Maybe this GitHub issue describes your problem and the workaround?

    这通常发生在没有运行 expo start 的发布时,运行 rm -rf .expo 来清除本地状态也是一个好主意

    it's listed in our common development errors

    您的最新编辑显示此错误消息并建议修复: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.您尝试过吗?

    【讨论】:

    • 您好,感谢您的回复。我已经检查过那个,但它没有用。我更新了我的问题。
    • 我附加到我的答案
    • 是的,我将.watchmanconfig 添加到我的根文件夹中,其中仅包含{}。错误 connect ECONNREFUSED 127.0.0.1:8888 正在显示。
    • 当我尝试检查我的世博会帐户时,我上面的评论中也出现了同样的错误:expo login
    • 当然听起来好像应该在端口 8888 上监听的东西实际上并没有在监听。好的,你配置了守望者。配置完watchman服务你启动了吗?
    猜你喜欢
    • 2020-10-10
    • 1970-01-01
    • 2016-06-20
    • 2022-10-24
    • 1970-01-01
    • 2017-09-09
    • 2020-06-23
    • 1970-01-01
    • 2021-07-05
    相关资源
    最近更新 更多