android – watchman:加载共享库时出错:libpcre.so.1

我在Ubuntu 15.10上,我正在使用react-native(0.20.0)开发
Android(SDK 23)应用程序.我正在使用节点5.6.0和npm 3.6.0.

我在运行react-native start时遇到了一个watchman错误

ERROR  watchman--no-pretty get-sockname returned with exit code 127 watchman: 
error while loading shared libraries: libpcre.so.1: cannot open shared object 
file: No such file or directory

    at ChildProcess.<anonymous> (/home/rachael/Dev/InstaGo/node_modules/fb-watchman/index.js:198:18)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:827:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at Pipe._onclose (net.js:471:12)

当我运行sudo find / -name libpcre.so.1时,返回以下内容:

/home/rachael/.linuxbrew/lib/libpcre.so.1
/home/rachael/.linuxbrew/Cellar/pcre/8.38/lib/libpcre.so.1

我试过重新安装守望者:

make uninstall

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

我也用linuxbrew尝试过:

npm r -g watchman 
brew update && brew upgrade
brew install watchman

这给出了一个完全不同的错误:

A non-recoverable condition has triggered.  Watchman needs your help!
The triggering condition was at timestamp=1407695600: inotify-add-watch(/my/path) -> Cannot allocate memory
All requests will continue to fail with this message until you resolve
the underlying problem.  You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch

Facebook的故障排除页面非常模糊,我无法解决该错误.

我对此很新,所以我很感激这个问题的任何帮助.感谢您的时间.

更新

通过linuxbrew安装watchman.

使用linuxbrew时,请记住在安装任何公式之前包含以下命令:

export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
brew update && brew upgrade

然后安装最新版本的watchman:

brew install --HEAD watchman

然后增加inotify用户实例,用户监视和排队事件的数量:

echo fs.inotify.max_user_instances=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
echo fs.inotify.max_queued_events=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

现在守望者应该工作和反应 – 本地开始应该运行良好!

最佳答案 您发布的第一个问题是与ldconfig相关的问题;由于pcre二进制文件未安装在系统库路径中,因此运行时链接程序无法在运行时解析它们,因此无法启动watchman二进制文件.

我无法帮助您直接解决问题的这一部分,但这听起来就像您尝试的后续步骤让您处于更好的位置.

请注意,当前发布的守望者版本是4.5.0;您所关注的路线已过时(您能否告诉我您在哪里找到这些路线?)
https://facebook.github.io/watchman/docs/install.html始终拥有当前信息.

现在,到毒药问题:

您看到的错误消息中包含一个(损坏,抱歉!)链接到https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify_add_watch,其中包含对正在发生的事情的一些解释.

您需要阅读本节有关正确设置系统限制的内容:
https://facebook.github.io/watchman/docs/install.html#system-specific-preparation

完成后,您可以通过运行watchman shutdown-server来清除状态

这有帮助吗?我想知道你发现哪些部分含糊不清,以便我可以为其他人改进它!

点赞