Chr*_*rvi 7 macos watchman react-native
几天前我在 Facebook/react-native 上创建了一个问题,但尚未收到回复。为了尝试让我启动并运行,我也会在这里询问。问题链接
我检查了有关此事的其他 SO 帖子,但没有任何建议有帮助。
我正在按照 Mac/iOS 的入门文档来创建 AwesomeProject 示例应用程序。当我使用启动项目时
npx react-native start
Run Code Online (Sandbox Code Playgroud)
并在 Xcode 中构建 iOS 应用程序,应用程序启动(在模拟器中)以显示白色初始屏幕,顶部显示“正在从 Metro 加载...”。大约一分钟后,我收到以下错误:
Could not connect to development server.
Ensure the following:
- Node server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
- WiFi is enabled and connected to the same network as the Node Server
URL: http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.AwesomeProject
Run Code Online (Sandbox Code Playgroud)
在我启动服务器的终端中,我看到:
2021-11-13T16:46:53,199: [cli] unable to talk to your watchman on /usr/local/var/run/watchman/chrisluxoft-state/sock! (No such file or directory)
Watchman: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2021-11-13T16:46:53,199: [cli] unable to talk to your watchman on /usr/local/var/run/watchman/chrisluxoft-state/sock! (No such file or directory)
Run Code Online (Sandbox Code Playgroud)
我导航到
/usr/local/var/run/watchman/chrisluxoft-state/
Run Code Online (Sandbox Code Playgroud)
并且目录中没有文件。
我跑了
watchman --foreground --logfile=[pathtodesktop]/log.txt
Run Code Online (Sandbox Code Playgroud)
按照此处的建议,生成以下日志:
2021-11-13T16:49:35,574: [listener] Watchman 2021.11.08.00 <no build info set> starting up on Grey-Mac.local
2021-11-13T16:49:35,581: [listener] file limit is 2560 kern.maxfilesperproc=49152
2021-11-13T16:49:35,581: [listener] raised file limit to 49152
2021-11-13T16:49:35,581: [listener] launchd checkin failed: No such process
2021-11-13T16:49:35,582: [sanitychecks] starting sanityCheckThread
Run Code Online (Sandbox Code Playgroud)
当我回到
/usr/local/var/run/watchman/chrisluxoft-state/
Run Code Online (Sandbox Code Playgroud)
我看到现在有两个文件:pid & sock=
受此鼓舞,我重新启动进程并在 Xcode 中重建应用程序。结果相同,只是这次终端中的错误是:
2021-11-13T16:56:49,310: [cli] unable to talk to your watchman on /usr/local/var/run/watchman/chrisluxoft-state/sock! (Connection refused)
Watchman: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2021-11-13T16:56:49,310: [cli] unable to talk to your watchman on /usr/local/var/run/watchman/chrisluxoft-state/sock! (Connection refused)
Run Code Online (Sandbox Code Playgroud)
再次看着
/usr/local/var/run/watchman/chrisluxoft-state/
Run Code Online (Sandbox Code Playgroud)
我看到相同的两个文件。我期望有一个日志文件,但它不存在。
这是在具有多个用户帐户的 Mac 上,如果有影响的话(即权限)。
node、react-native、watchman 是由 Homebrew 安装的。我使用相同的用户帐户进行安装和执行。
反应本机信息
System:
OS: macOS 11.6.1
CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
Memory: 1.65 GB / 32.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 17.0.1 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.1.0 - /usr/local/bin/npm
Watchman: 2021.11.08.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /Volumes/WD_Internal/chrisluxoft/.rvm/gems/ruby-2.7.4/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7784292
Xcode: 13.0/13A233 - /usr/bin/xcodebuild
Languages:
Java: 11.0.12 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.3 => 0.66.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1771 次 |
最近记录: |