I'm on Ubuntu 15.10 and I am developing an Android (SDK 23) app using react-native (0.20.0). I'm using node 5.6.0 and npm 3.6.0.
I encountered a watchman error when running
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
git clone https://github.com/facebook/watchman.git
git checkout v4.1.0 # the latest stable release .
sudo make install
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
brew update && brew upgrade
brew install --HEAD watchman
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
The first problem that you posted is a ldconfig related problem; since the pcre binaries are not installed in the system library path, your runtime linker cannot resolve them at runtime and thus cannot start the watchman binary.
I cannot help you directly resolve that part of the problem, but it sounds like the later steps you tried put you in a better position.
Please note that the current released version of watchman is 4.5.0; the directions you were following are outdated (Could you tell me where you found those directions?) https://facebook.github.io/watchman/docs/install.html always has the current information.
Now, to the poison issue:
The error message you saw included a (broken, sorry!) link to https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify_add_watch that has some explanation about what is happening.
You need to read this section on setting up your system limits correctly: https://facebook.github.io/watchman/docs/install.html#system-specific-preparation
and once done, you can clear the state by running
Did that help? I'd like to understand which parts of this you found vague so that I can improve it for others!