2016-11-04 67 views
1

我第一次得到這個問題:https://github.com/facebook/react-native/issues/10088陣營本地`NPM start`與守望錯誤

然後我跟着這個解決方案來解決該問題:https://github.com/facebook/react-native/issues/910#issuecomment-94181845

現在,當我進入npm start我得到[sane] Warning: Lost connection to watchman, reconnecting..。有什麼建議麼?

更新:當我將MacOS更新到MacOS Sierra時,開始發生這種情況。

output after <code>npm start</code>

更新:所以我試圖運行react-native run-ios這將打開一個新的控制檯窗口和調用npm start。它仍然給出了[sane] Warning: Lost connection to watchman, reconnecting..警告,但它構建了捆綁包。所以看守人之間的連接正在中斷。這裏是控制檯的截圖: screenshot of console

+0

您是否通過守望者故障排除指南運行?首先要開始查看日誌:https://facebook.github.io/watchman/docs/troubleshooting.html#where-are-the-logs –

回答

8

我按照提供的解決方案解決了這個問題由大衛,但我不得不做一些額外的步驟,因爲我已經安裝了使用brew的守望者。下面是該解決方案的命令列表:(由BREW安裝)

刪除守望:

$ brew install rmtree 
$ brew rmtree watchman 
$ sudo rm -rf /usr/local/var/run/watchman 

手動安裝柝V4.7.0(學分大衛):

$ git clone https://github.com/facebook/watchman.git 
$ cd watchman 
$ git checkout v4.7.0 
$ ./autogen.sh 
$ ./configure 
$ make 
$ sudo make install 

您CHMOD用戶的守望者狀態目錄:

$ chmod 0700 /usr/local/var/run/watchman/<user>-state 
+0

我在封裝Exponent時遇到同樣的問題看起來這是老版本的守望員已知的問題(https://facebook.github.io/watchman/docs/troubleshooting.html,一直滾動到底部)。一個簡單的「brew重新安裝看守」它對我來說 – Fractaly

+3

'brew install rmtree '不適合我,但'brew tap beeftornado/rmtree'完成了這項工作 –

1

運行項目文件夾內此命令

watchman watch-del-all && npm start --reset-cache 
+0

沒有運氣:(仍然得到相同的警告:'失去了連接看門人,重新連接...' – Simar

1

我有一個simular問題,看日誌看守我得到這些錯誤每次看到「丟失連接時發生給Watchman「的信息。

2016-11-05T03:35:48,401: [listener] Watchman 4.7.0 <no build info set> starting up on Davids-Mac.local 

2016-11-05T03:35:48,401: [listener] path /Users/david/Projects/react-native-test is on filesystem type hfs 

2016-11-05T03:35:48,402: [listener] root /Users/david/Projects/react-native-test using watcher mechanism fsevents (auto was requested) 

2016-11-05T03:35:48,406: [listener] file limit is 2560 kern.maxfilesperproc=10240 

2016-11-05T03:35:48,406: [listener] raised file limit to 10240 

2016-11-05T03:35:48,407: [listener] Using socket from launchd as listening socket 

2016-11-05T03:35:48,934: [io 0x7f8175600ff8 /Users/david/Projects/react-native-test] PERF: {"ru_nvcsw": 0, "ru_nsignals": 0, "ru_msgrcv": 6, "ru_msgsnd": 6, "ru_inblock": 0, "ru_majflt": 0, "ru_nswap": 0, "ru_minflt": 5230, "ru_ixrss": 0, "ru_maxrss": 21405696, "system_time": 0.32367200000000002, "user_time": 0.18271599999999999, "elapsed_time": 0.53129999999999999, "pid": 9867, "ru_idrss": 0, "meta": {"root": {"watcher": "fsevents", "ticks": 2, "number": 1, "case_sensitive": false, "recrawl_count": 0, "path": "/Users/david/Projects/react-native-test"}}, "version": "4.7.0", "ru_oublock": 0, "ru_nivcsw": 112, "start_time": 1478316948.403332, "description": "full-crawl"} 

2016-11-05T03:35:48,935: [io 0x7f8175600ff8 /Users/david/Projects/react-native-test] crawl complete 

2016-11-05T03:35:49,029: [client=0x7f8176a00038:stm=0x7f8176a00000] Unilateral payload for sub sane-sub {"settled": true} 

Terminating due to signal 11 Segmentation fault generated by pid=0 uid=0. address not mapped to object (0x0) 
0 watchman       0x0000000105973759 _ZL13crash_handleriP9__siginfoPv + 347 
1 libsystem_platform.dylib   0x00007fffa2292bba _sigtramp + 26 
2 ???         0x00007f81756000c0 0x0 + 140193996734656 
3 watchman       0x000000010596f9b2 _ZN6detail22estimateSpaceToReserveIPKcJA3_cA28_c8w_stringA2_cPcS6_EEEmmRKT_DpRKT0_ + 109 
4 watchman       0x000000010596f815 _ZN8w_string5buildIJPcRA4_KcPS2_RA3_S2_RA28_S2_RS_RA2_S2_RS1_SC_EEES_DpOT_ + 121 
5 watchman       0x000000010599b4cb _ZN8watchman3Log3logIJRA28_KcR8w_stringRA2_S2_RPcS8_EEEvNS_8LogLevelEDpOT_ + 183 
6 watchman       0x000000010599a6e0 _ZNSt3__114__thread_proxyINS_5tupleIJZL15make_new_clientP15watchman_streamE3$_0EEEEEPvS6_ + 952 
7 libsystem_pthread.dylib    0x00007fffa229cabb _pthread_body + 180 
8 libsystem_pthread.dylib    0x00007fffa229ca07 _pthread_body + 0 
9 libsystem_pthread.dylib    0x00007fffa229c231 thread_start + 13 

UPDATE: 好吧,發現迄今似乎工作的解決方案。我卸載守望完全,然後用這似乎做工精細下面從源代碼編譯它(通過BREW安裝任何嘗試會導致上述問題,但這個工程):

$ git clone https://github.com/facebook/watchman.git 
$ cd watchman 
$ git checkout v4.7.0 # the latest stable release 
$ ./autogen.sh 
$ ./configure 
$ make 
$ sudo make install 
+0

只是想補充一點,我能夠通過執行以下操作來解決此問題: – David

+0

好吧我得到了它的工作,但在運行'sudo make install'之前我必須做 'sudo rm -rf/usr/local/var/run/watchman'。在'sudo make install'之後,我必須做'chmod 0700/usr/local/var/run/watchman/ -state' – Simar