看守:加载共享库时出错:libpcre.so.1
我在Ubuntu 15.10上,并且正在使用react-native(0.20.0)开发一个Android(SDK 23)应用程序。 我正在使用节点5.6.0和npm 3.6.0。
运行react-native start
时遇到了一个守望者错误
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安装守望者。
使用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
然后安装最新版本的守望者:
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
现在看守应该工作, react-native start
应该运行良好!
你发布的第一个问题是一个与ldconfig相关的问题; 由于pcre二进制文件未安装在系统库path中,因此运行时链接程序无法在运行时parsing它们,因此无法启动守望二进制文件。
我不能帮你直接解决这个问题的一部分,但是听起来好像后面的步骤让你处于更好的位置。
请注意,目前发布的守望者版本是4.5.0; 你所遵循的方向是过时的(你能告诉我你在哪里find这些方向?) 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
来清除状态
这有帮助吗? 我想了解这个你发现哪些部分是模糊的,这样我可以改善他人!
关于完全不同的错误 。
你有看守员已经运行,所以当你做react-native start
它试图启动另一个。
- 首先运行
watchman shutdown-server
- 再次打开你的模拟器
- 在terminal中调用
react-native start
- 在模拟器中打开您的应用程序。
一切都应该工作。 它为我做了。