ubuntu 下如何安装watchman?



  • 照着这篇文章安装了watchman
    使用watchman watch /项目目录 提示

    tanx@tanx-desktop:~$ watchman watch /home/tanx/fake
    Thu Dec 10 2015 14:38:02 - Running action...

    /home/tanx/.nvm/versions/node/v4.0.0/lib/node_modules/watchman/watchman:139
    throw "Target file not found: " + target;
    ^
    Target file not found: watch

    react-native start也不能正常工作
    [code]
    React packager ready.

    ERROR: Unknown option --no-pretty

    Watchman: watchman--no-pretty get-sockname returned with exit code 1 ERROR: Unknown option --no-pretty

    ERROR watchman--no-pretty get-sockname returned with exit code 1 ERROR: Unknown option --no-pretty

    Error: watchman--no-pretty get-sockname returned with exit code 1 ERROR: Unknown option --no-pretty

    at ChildProcess.<anonymous> (/home/tanx/fack/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/index.js:194:18)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:817:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
    

    See http://facebook.github.io/react-native/docs/troubleshooting.html
    for common problems and solutions.

    [/code]
    有大侠知道这种问题出现的原因吗~在线等



  • 先装homebrew的linux版本linuxbrew
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
    sudo apt-get install build-essential
    设置brew环境
    vi .bashrc
    添加
    export PATH="$HOME/.linuxbrew/bin:$PATH"
    export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
    export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
    保存esc 后 :wq!
    安装dependency
    sudo apt-get install libxml2-dev libxslt1-dev python-dev
    sudo apt-get install zlib1g-dev
    sudo apt-get install libevent-dev
    sudo apt-get install libtool
    用brew装watchman
    brew install watchman