首页 > 解决方案 > 使用 Expo 运行 React Native 教程时出现“无法连接到开发服务器”错误,怀疑 Watchman

问题描述

新反应原生和移动开发,遇到这个问题:

我正在使用 Expo CLI 作为构建工具从 Facebook 网站运行 React Native hello world。我所做的是安装 Expo,运行expo init test,安装 cocoapods,然后 cd 进入测试目录并运行expo start.

当我在 iOS 模拟器或我的 iPhone 上打开应用程序时,在白屏大约 3-5 分钟后出现“无法连接到开发服务器”(见截图)。

在世博会日志中。值得注意的是,每次启动时,我都会收到以下错误日志:

2019-08-25T21:49:21,474: [cli] Failed to open /Users/nsadeh/Library/LaunchAgents/com.github.facebook.watchman.plist for write: Not a directory

ERROR
21:49
Watchman:  watchman --no-pretty get-sockname returned with exit code=null, signal=SIGABRT, stderr= 2019-08-25T21:49:21,474: [cli] Failed to open /Users/nsadeh/Library/LaunchAgents/com.github.facebook.watchman.plist for write: Not a directory

我已经尝试卸载和重新安装 Watchman 以及 Expo。不知道还能做什么。

重现:

运行expo init并从顶层目录expo start在此处输入图像描述

标签: react-nativeexpowatchman

解决方案


解决方案:原来 postgreSQL 在我的库中留下了一个不相关的 LaunchAgents.plist 文件,这让 Watchman 感到困惑。重命名它解决了这个问题。


推荐阅读