我正在学习使用
解决方法是执行以下命令:
我已成功安装了
react-native
编程来开发Android应用程序。在运行应用程序时,我遇到了一些错误unable to resolve module
。我找到了一些相关链接,并建议运行此命令react-native start --reset-cache
,该命令需要系统上安装watchman
。我安装了watchman
,但之后无法启动react-native
。解决方法是执行以下命令:
react-native start
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>
我已成功安装了
watchman
,但在尝试执行watchman
命令时出现问题。这是我安装watchman
的位置:D:\React Native\Example 1\ExampleOne\node_modules\watchman
。我已将其添加到Windows机器的PATH
中。但我不确定问题的根本原因是路径是否错误或我指向了错误的watchman
目录?有人能告诉我如何解决这个问题吗?先感谢您了。以下是相关图片: