为什么“守望者爬行失败"更新到 macOS catalina 后立即反应原生错误? [英] Why "Watchman crawl failed" error in react-native immediately after updating to macOS catalina?

查看:59
本文介绍了为什么“守望者爬行失败"更新到 macOS catalina 后立即反应原生错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试运行 react-native run-ios 或从 xcode 构建 RN 项目,metro bundler 一启动,终端中就会出现此错误:

Trying to run react-native run-ios or build RN project from xcode, as soon as metro bundler starts, this error appears in the terminal:

Loading dependency graph...jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
  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.
  Error: Watchman error: resolve_projpath: path `/Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA`: open: /Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA: Operation not permitted. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html.
events.js:183
      throw er; // Unhandled 'error' event
  ^

Error: resolve_projpath: path `/Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA`: open: /Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA: Operation not permitted
    at BunserBuf.<anonymous> (/Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA/node_modules/fb-watchman/index.js:95:23)
    at emitOne (events.js:116:13)
    at BunserBuf.emit (events.js:211:7)
    at BunserBuf.process (/Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA/node_modules/bser/index.js:292:10)
    at /Users/vorousjames/Desktop/Development/TicTacWHOA/app/TicTacWHOA/node_modules/bser/index.js:247:12
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

这在 Catalina 更新之前从未发生过.从一开始,我的项目根目录中就有一个空的 watchman 配置文件.在第一次启动后更新时,终端中有一个弹出窗口,说一些关于权限的内容,但我不记得了.我的终端在 Visual Studio 代码中也有一条通知,说默认 shell 更改为 zsh"运行 chsh -s/bin/zsh 进行更改,所以我做了.

This never happened before the Catalina update. I've had an empty watchman config file in the root of my project since the beginning. On first boot post-update, there was a popup in terminal saying something about permissions but i dont remember exactly. there's also a notice in my terminal in visual studio code saying "the default shell changed to zsh" run chsh -s /bin/zsh to change, so i did.

我试过了:

  • watchman watch-del-all

watchman server-shutdown

从系统首选项->隐私选项卡中添加对终端的全盘访问

adding full disk access to terminal from within system preferences->privacy tab

npm uninstall watchman &npm uninstall -g watchman

推荐答案

更新到 Catalina 后,我遇到了同样的问题.Wez Furlong 的回答对我有用,但我必须为 watchman 提供完整的磁盘访问权限才能运行 watchman watch-project 命令而不会出现不允许操作"错误.作为之前故障排除的一部分,我还提供了对 Xcode 和终端的完整磁盘访问(不确定这是否也有助于修复).

I had the same issue after updating to Catalina. Wez Furlong's answer worked for me, but I had to provide full disk access to watchman in order to run watchman watch-project command without getting "Operation not permitted" error. As part of prior troubleshooting, I also had provided full disk access to Xcode and Terminal (not sure if this also contributed to the fix).

这篇关于为什么“守望者爬行失败"更新到 macOS catalina 后立即反应原生错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆