文章目录

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、安装 pcrepcrewatchman 的依赖安装包

1
2
$ brew link pcre
Linking /usr/local/Cellar/pcre/8.38... 133 symlinks created

7、再次安装 watchman,提示安装成功

1
2
3
4
5
$ brew install watchman
==> Downloading https://homebrew.bintray.com/bottles/watchman-4.4.0.el_capitan.b
Already downloaded: /Library/Caches/Homebrew/watchman-4.4.0.el_capitan.bottle.tar.gz
==> Pouring watchman-4.4.0.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/watchman/4.4.0: 20 files, 343.7K

参考资料


0、Brew error: Could not symlink, path is not writable

1、watchman : unknown option –no-pretty error while npm start

2、HomeBrew-Readme

文章目录