Android 错误:在windows中的路径中找不到Watchman
我正在学习Android 错误:在windows中的路径中找不到Watchman,android,npm,react-native,react-native-android,Android,Npm,React Native,React Native Android,我正在学习react native编程来开发android应用程序。在运行应用程序时,我遇到一些错误,无法解析模块。我找到了一些相关链接,建议运行此命令react native start--reset cache,这反过来需要系统上的watchman。我安装了watchman之后无法启动react native 反应本机启动 我已成功安装了watchman&当我试图执行watchman命令时,它正在发生 这是安装mywatchman的地方。我也在我的windows机器路径中添加了这个D:\
react native
编程来开发android应用程序。在运行应用程序时,我遇到一些错误,无法解析模块。我找到了一些相关链接,建议运行此命令react native start--reset cache
,这反过来需要系统上的watchman
。我安装了watchman
之后无法启动react native
反应本机启动
我已成功安装了watchman
&当我试图执行watchman
命令时,它正在发生
这是安装mywatchman
的地方。我也在我的windows机器路径中添加了这个<代码>D:\React Native\Example 1\Example one\node\u modules\watchman
路径是D:\React Native\Example 1\Example one\node\u modules\watchman
我不确定这个问题的原因是什么。我的路径是错误的还是指向了看守人的错误目录?有人能告诉我如何解决这个问题吗。提前感谢这通常发生在看守人不在运行时。在项目的根文件夹中创建一个空的.watchmanconfig
文件,或者在项目中初始化git或hg存储库
因此,您应该创建一个空的.watchmanconfig
文件或/并使用npm install初始化文件夹您只需卸载watchman
npm软件包即可解决此问题。尝试在全局和本地卸载它npm uninstall-g watchman
npm uninstall watchman
Hi@TGMCians,此解决方案使“react native start”能够运行,但在运行“react native run android”时,我收到一个错误消息:EPERM:operation not allowed。。。emulator的红色错误屏幕显示:无法获取BatchedBridge,请确保您的包已正确打包。顺便说一句,我用的是Windows7,你知道吗?非常感谢。感谢您的回复,TGMCians,这并没有解决问题,但cmd中的错误消息已经消失,唯一的问题是模拟器中的红色屏幕,它仍然说:“无法获取BatchedBridge,请确保您的包已正确打包”,我正在考虑是否应该重新安装watchman。你说什么?@VincentZHANG YepThank you@TGMCians,这又把cmd中的错误带了回来,我回到了起点。
D:\React Native\Example 1\ExampleOne>react-native start
Scanning 560 folders for symlinks in D:\React Native\Example 1\ExampleOne\node_m
odules (27ms)
┌────────────────────────────────────────────────────────────────────────────┐
│ Running packager on port 8081. │
│ │
│ Keep this packager running while developing on any JS projects. Feel │
│ free to close this tab and run your own packager instance if you │
│ prefer. │
│ │
│ https://github.com/facebook/react-native │
│ │
└────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
D:\React Native\Example 1\ExampleOne
Loading dependency graph...Watchman: Watchman was not found in PATH. See https
://facebook.github.io/watchman/docs/install.html for installation instructions
React packager ready.
jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
Usually this happens when watchman isn't running. Create an empty `.watchmanco
nfig` file in your project's root folder or initialize a git or hg repository in
your project.
Error: Watchman was not found in PATH. See https://facebook.github.io/watchma
n/docs/install.html for installation instructions
Watchman: Watchman was not found in PATH. See https://facebook.github.io/watch
man/docs/install.html for installation instructions
ERROR Watchman was not found in PATH. See https://facebook.github.io/watchman
/docs/install.html for installation instructions
{"code":"ENOENT","errno":"ENOENT","syscall":"spawn watchman","path":"watchman","
spawnargs":["--no-pretty","get-sockname"]}
Error: Watchman was not found in PATH. See https://facebook.github.io/watchman/
docs/install.html for installation instructions
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
D:\React Native\Example 1\ExampleOne>