必威体育Betway必威体育官网
当前位置:首页 > IT技术

[ractNative]watchman 起不来,page loading不出来

时间:2019-09-02 03:42:11来源:IT技术作者:seo实验室小编阅读:66次「手机版」
 

watchman

    • 出处
    • 表现
    • 解决方式
      • 删除 watchman 之前用 brew装的
      • Manually install Watchman v470 credits to David
      • chmod your users watchman state directory

出处

https://stackoverflow.com/questions/40414166/react-native-npm-start-with-watchman-ERROR/40441481#40441481

表现

//启动后给的信息,watchman 起不来

Looking for JS files in
   /Users/tomlucky/otherCode/RN/AwesomeProject 


Metro Bundler ready.

Loading dependency graph...
 BUNDLE  [Android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1)2018-01-09T18:09:37,917: [cli] unable to talk to your watchman on /usr/local/var/run/watchman/tomlucky-state/sock! (No such file or directory)

Watchman:  watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2018-01-09T18:09:37,917: [cli] unable to talk to your watchman on /usr/local/var/run/watchman/tomlucky-state/sock! (No such file or directory)

jest-haste-map: Watchman crawl failed. retrying once with node crawler.
  Usually this hAPPens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
  Error: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2018-01-09T18:09:37,917: [cli] unable to talk to your watchman on /usr/local/var/run/watchman/tomlucky-state/sock! (No such file or directory)

2018-01-09T18:12:02,864: [cli] unable to talk to your watchman on /usr/local/var/run/watchman/tomlucky-state/sock! (No such file or directory)

Watchman:  watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2018-01-09T18:12:02,864: [cli] unable to talk to your watchman on /usr/local/var/run/watchman/tomlucky-state/sock! (No such file or directory)
 ERROR  watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2018-01-09T18:12:02,864: [cli] unable to talk to your watchman on /usr/local/var/run/watchman/tomlucky-state/sock! (No such file or directory)

Loading dependency graph...
 BUNDLE  [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1)Process terminated. Press <enter> to close the window

解决方式

删除 watchman (之前用 brew装的):


$ brew install rmtree //我的这句报错,用的 
                      //brew tap beeftornado/rmtree
$ brew rmtree watchman
$ sudo rm -rf /usr/local/var/run/watchman

Manually install Watchman v4.7.0 (credits to David):

$ git clone https://github.com/facebook/watchman.git
$ cd watchman
$ git checkout v4.7.0  //我用的时候,master就是4.7,所以没必要切branch
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

Chmod your user’s watchman state directory:

//我这个没用,直接就可以跑起来了。
$ chmod 0700 /usr/local/var/run/watchman/<user>-state

相关阅读

分享到:

栏目导航

推荐阅读

热门阅读