How to install watchman on Ubuntu 18.04, for react-native? error in make command

ref. https://facebook.github.io/watchman/docs/install.html#installing-from-source

git clone https://github.com/facebook/watchman.git
cd watchman/
git checkout v4.9.0
sudo apt-get install -y autoconf automake build-essential python-dev libssl-dev libtool
./autogen.sh
./configure
make
sudo make install

Make sure to run git checkout v4.9.0. That is, check out v4.9.0, not v4.7.


Watchman version 4.7.0 isn't compatible with GCC 7.x, as reported here:
https://github.com/facebook/watchman/issues/467

Note, Ubuntu 18.04 ships with GCC 7.3.

Try building the latest version, v4.9.0, in which the issue is fixed:
https://github.com/facebook/watchman/releases/tag/v4.9.0

Alternatively, use an earlier GCC version for building Watchman, such as 5.4.


Watchman is available in Debian sid and Ubuntu 20.04 and can be installed via 'apt-get install watchman'.