0、在使用运行 react-native for ios 时,在终端可能遇到 ERROR watchman–no-pretty
1、查看watchman的版本时,可能会输出一下信息
1 2 3 4 5
$ watchman --version dyld: Library not loaded: /usr/local/opt/pcre/lib/libpcre.1.dylib Referenced from: /usr/local/Cellar/watchman/4.4.0/libexec/bin/watchman Reason: image not found Trace/BPT trap: 5
2、使用brew软件安装watchman,可能会遇到一下信息
1 2
$ brew install watchman Error: You must `brew link pcre` before watchman can be installed
3、输入 brew link pcre,提示一下信息
1 2 3 4
$ brew link pcre Linking /usr/local/Cellar/pcre/8.38... Error: Could not symlink lib/libpcre.1.dylib /usr/local/lib is not writable.
4、使用 brew doctor 命令,进行查错
1 2 3 4
$ brew doctor //会提示错误信息 Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry and just ignore them. Thanks!
5、输入以上的 Warning 提示
1
$ sudo chown -R $(whoami) /usr/local/lib
6、安装 pcre ,pcre是 watchman 的依赖安装包
1 2
$ brew link pcre Linking /usr/local/Cellar/pcre/8.38... 133 symlinks created