【发布时间】:2017-03-03 11:19:20
【问题描述】:
我正在学习react-native 编程来开发android 应用程序。在运行时运行应用程序时,我遇到了一些错误unable to resolve module。我找到了一些链接,并建议运行此命令react-native start --reset-cache,而这又需要系统上的watchman。我安装了watchman 然后我无法启动react-native
react-native 开始
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 的安装位置。我也在我的 Windows 机器的 PATH 中添加了这个。 D:\React Native\Example 1\ExampleOne\node_modules\watchman
PATH 是 D:\React Native\Example 1\ExampleOne\node_modules\watchman
我不确定导致此问题的原因。我的路径是错误的还是我指向了 watchman 的错误目录?谁能建议我如何解决这个问题。提前致谢
【问题讨论】:
标签: android npm react-native react-native-android