当我想在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)
我试过“守望者手表〜路径”,“sudo”& “chmod”,但他们没有帮助我。
有人可以告诉我吗?
答案 0 :(得分:2)
cd AwesomeProject,并执行chmod -R 777 *
它仍然失败。
在我允许顶级目录之后,它起作用了!
chmod 777 AwesomeProject
答案 1 :(得分:1)
通过重新安装守望者来解决
brew update
brew reinstall watchman
答案 2 :(得分:1)
检查pid并杀死
lsof -n -i4TCP:8081 | grep LISTEN
使用root
运行此命令react-native start
答案 3 :(得分:1)
我已经尝试了以上所有方法,并且没有一个解决方案有效,请尝试:
输入watchman watch ./
在您要运行的RN项目的顶级目录中,
然后再次react-native run-ios
答案 4 :(得分:0)
检查pid
PM> add-migration <name>
PM> update-database
并杀死pid
以root身份运行
lsof -n -i4TCP:8081 | grep LISTEN