经过一段时间(以及对当前运行macOS Big Sur 11.4
的mac的一些更新(后,我确实尝试通过运行npm run start
来简单地启动我的expo应用程序,事实上这与运行expo start
相同
这在浏览器和CLI中打开了expo。几秒钟后expo
断开连接,出现错误:
Expo Developer Tools is disconnected from Expo CLI. Use the expo start command to start the CLI again.
在终端窗口中,我发现了这个错误:
Error: EMFILE: too many open files, watch
at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:178:28)
请注意,这是一个与以下问题不同的问题:Expo Developer Tools与Expo CLI断开连接。使用expo-start命令再次启动CLI
经过研究,我发现我需要重新安装watchman
然而,运行brew reinstall watchman
给了我警告:
Warning: You are using macOS 11.4.
We do not provide support for this pre-release version.
You will encounter build failures with some formulae.
在安装结束时,我遇到了一个新错误:
==> Reinstalling watchman
Error: Your CLT does not support macOS 11.4.
It is either outdated or was modified.
Please update your CLT or delete it if no updates are available.
现在该怎么办?
也许不需要一些步骤,但运行它们所有都解决了问题:
- 将XCode更新到最新版本(当前:
12.5.1
( - 运行
sudo rm -rf /Library/Developer/
删除/Library/Developer/
- 通过运行以下命令再次安装命令行开发人员工具:
sudo xcode-select --install
- 点击弹出窗口中的安装按钮,然后同意T&C
- 打开XCode并允许安装其他工具
- 运行
brew update
- 运行
brew reinstall watchman
-这将最终更新watchman
,并且将比以前运行以错误结束的同一命令花费更多的时间
现在我可以很好地启动expo
,它不再断开连接。