r.o*_*gan 5 android facebook node.js watchman react-native
我在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)
Run Code Online (Sandbox Code Playgroud)
当我运行时sudo find / -name libpcre.so.1,返回以下内容:
/home/rachael/.linuxbrew/lib/libpcre.so.1
/home/rachael/.linuxbrew/Cellar/pcre/8.38/lib/libpcre.so.1
Run Code Online (Sandbox Code Playgroud)
我试过重新安装watchman:
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
Run Code Online (Sandbox Code Playgroud)
我也用linuxbrew尝试过:
npm r -g watchman
brew update && brew upgrade
brew install watchman
Run Code Online (Sandbox Code Playgroud)
这给出了一个完全不同的错误:
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
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
然后安装最新版本的watchman:
brew install --HEAD watchman
Run Code Online (Sandbox Code Playgroud)
然后增加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
Run Code Online (Sandbox Code Playgroud)
现在值班员应该可以正常工作了react-native start!
您发布的第一个问题是 ldconfig 相关问题;由于 PCRE 二进制文件未安装在系统库路径中,因此运行时链接器无法在运行时解析它们,因此无法启动 watchman 二进制文件。
我无法帮助您直接解决问题的这一部分,但听起来您尝试的后续步骤使您处于更好的位置。
请注意,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
有帮助吗?我想了解您发现其中哪些部分含糊不清,以便我可以为其他人改进!
| 归档时间: |
|
| 查看次数: |
1051 次 |
| 最近记录: |