我學習react-native
編程開發Android應用程序。在運行時運行應用程序時出現錯誤unable to resolve module
。我找到了一些鏈接,並建議運行此命令react-native start --reset-cache
,而這又需要系統上的watchman
。我安裝watchman
那麼我之後無法啓動react-native
錯誤:在柝路徑找不到在Windows
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
安裝位置。我在我的windows機器的PATH中添加了這個。 D:\React Native\Example 1\ExampleOne\node_modules\watchman
PATH
是d:\陣營本地\例1 \ ExampleOne \ node_modules \守望
我不知道這可能是這個問題的原因。我的路徑是錯誤的還是我指向錯誤的目錄watchman
?任何人都可以建議我如何解決這個問題。在此先感謝
嗨@TGMCians,該解決方案使「反應本土起步」能夠運行,但運行時「反應原生運行Android的,我得到了一個錯誤說:EPERM:不允許操作,...,紅色模擬器的錯誤屏幕顯示:無法獲得BatchedBridge,請確保您的包已正確打包。我使用Windows 7 btw,你有什麼想法嗎?謝謝! – VincentZHANG
你可以試試這個https://stackoverflow.com/a/43217182/1741671 –
謝謝你的回覆,TGMCians,它沒有解決問題,但是cmd中的錯誤信息沒有了,唯一的問題是紅色屏幕仍然顯示:'無法獲得BatchedBridge,請確保您的包已正確打包',我正在考慮是否應該安裝守望者。你說什麼? – VincentZHANG