【发布时间】:2019-10-10 08:16:02
【问题描述】:
尝试运行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)
这在 Catalina 更新之前从未发生过。从一开始,我的项目根目录中就有一个空的守望者配置文件。在更新后的第一次启动时,终端中有一个弹出窗口说一些有关权限的信息,但我不记得确切。在 Visual Studio 代码中我的终端中还有一条通知说“默认 shell 已更改为 zsh”运行 chsh -s /bin/zsh 进行更改,所以我做到了。
我试过了:
watchman watch-del-allwatchman server-shutdown从系统首选项->隐私选项卡中添加对终端的完整磁盘访问
npm uninstall watchman&npm uninstall -g watchman
【问题讨论】:
-
[将其移至答案,尽管它更像是故障排除]
标签: react-native terminal react-native-android react-native-ios watchman