Jim*_*Jim 6 terminal watchman react-native react-native-android react-native-ios
尝试react-native run-ios从 xcode运行或构建 RN 项目,一旦 Metro bundler 启动,终端中就会出现此错误:
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)
Run Code Online (Sandbox Code Playgroud)
这在 Catalina 更新之前从未发生过。从一开始,我的项目根目录中就有一个空的 watchman 配置文件。在第一次启动后更新时,终端中有一个弹出窗口,说一些关于权限的内容,但我不记得了。我的终端在 Visual Studio 代码中也有一条通知,说“默认 shell 更改为 zsh”运行chsh -s /bin/zsh更改,所以我做了。
我试过了:
watchman watch-del-all
watchman server-shutdown
从系统首选项-> 隐私选项卡中添加对终端的完整磁盘访问
npm uninstall watchman & npm uninstall -g watchman
Jub*_*ali 38
您需要授予对 的磁盘访问权限watchman。为此,您需要:
System preferences>Security & Privacy然后向下滚动Full Disk Access+按钮添加新的应用程序/工具Macintosh HD在文件夹列表中选择shift Command .同时按下该组合键可查看所有目录列表opt > brew > bin(对于 MacOS Catalina,watchman 安装在该文件夹中)|| usr > local > Cellar > Watchman > 21***** > bin(watchman安装在MacOS Monterey这个文件夹中)watchman在列表中查找然后选择它来吧,这应该可以解决问题。
小智 14
更新到 Catalina 后,我遇到了同样的问题。Wez Furlong 的回答对我有用,但我必须提供对 watchman 的完整磁盘访问权限才能运行 watchman watch-project 命令而不会出现“不允许操作”错误。作为先前故障排除的一部分,我还提供了对 Xcode 和终端的完整磁盘访问(不确定这是否也有助于修复)。

d36*_*ams 12
要更改 Watchman 对 Documents 文件夹的权限,它位于系统首选项中的安全和隐私 -> 文件和文件夹下
通过在 Document 文件夹下的列表中检查 Watchman 解决了我的问题
| 归档时间: |
|
| 查看次数: |
7274 次 |
| 最近记录: |