5

当我想在 Android 模拟器上运行我的项目时出现此错误。

[Hot Module Replacement] Server listening on /hot

React packager ready.

Failed to build DependencyGraph: Watchman error: query failed: synchronization failed: Permission denied. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html.
Error: Watchman error: query failed: synchronization failed: Permission denied. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html.
    at /Users/Ali/Desktop/app/Test/node_modules/react-native/node_modules/node-haste/lib/crawlers/watchman.js:63:11
    at process._tickCallback (node.js:368:9)

我试过 "watchman watch ~path" 、 "sudo" 和 "chmod" 但他们没有帮助我。

有人可以给我建议吗?

4

5 回答 5

10

通过重新安装守望者解决

brew update
brew reinstall watchman
于 2016-07-12T02:58:22.947 回答
2

cd AwesomeProject,执行chmod -R 777 *它仍然失败。在我授予顶级目录的权限后,它就起作用了! chmod 777 AwesomeProject

于 2016-05-23T23:17:08.480 回答
2

检查pid并杀死

lsof -n -i4TCP:8081 | grep LISTEN

使用 root 运行此命令

react-native start
于 2016-09-30T17:28:35.087 回答
1

我已经尝试了以上所有方法,但没有一个解决方案有效,试试这个:

类型watchman watch ./

在要运行的 RN 项目的顶层目录中,

然后再一次react-native run-ios

于 2017-06-20T23:50:31.347 回答
0

检查pid

lsof -n -i4TCP:8081 | grep LISTEN

并杀死pid

以root运行

react-native start
于 2016-09-30T17:25:02.513 回答