1

Trying to install Watchman for React Native on a fresh install of Ubuntu 20.04.

I'm using the following steps (but if there's a better way of doing it - or if you can avoid using Watchman altogether I'd be interested to hear) ...

  git clone https://github.com/facebook/watchman.git -b v4.9.0 --depth 1
  cd watchman/
  git checkout 
  ./autogen.sh
  ./configure --without-python --without-pcre --enable-lenient
  make

I get the error shown below during the 'make' step.

I've seen a number of questions related to building watchman but I haven't seen this situation.

tests/integration/cppclient.cpp: In function ‘int main(int, char**)’:
tests/integration/cppclient.cpp:114:12: error: ‘TimedOut’ does not name a type
  114 |    } catch(TimedOut& e) {
      |            ^~~~~~~~
tests/integration/cppclient.cpp:120:12: error: ‘TimedOut’ does not name a type
  120 |    } catch(TimedOut& e) {
      |            ^~~~~~~~
tests/integration/cppclient.cpp:25:9: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
   25 |   system("rm -f hit");
      |   ~~~~~~^~~~~~~~~~~~~
tests/integration/cppclient.cpp:75:9: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
   75 |   system("touch hit");
      |   ~~~~~~^~~~~~~~~~~~~
tests/integration/cppclient.cpp:88:9: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
   88 |   system("rm hit");
      |   ~~~~~~^~~~~~~~~~
make[1]: *** [Makefile:2766: tests/integration/cppclient_t-cppclient.o] Error 1
make[1]: Leaving directory '/home/rshea/src/watchman'
make: *** [Makefile:1264: all] Error 2
1
  • One alternative would be to use iwatch. So long as you’re not watching a million files, it’s a pretty decent tool 👍🏻
    – matigo
    Nov 16, 2021 at 10:08

2 Answers 2

1

Simply install the same watchman 4.9.0 package from official repository by using below commands (and maybe consult with official guide):

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install watchman

If you are still sure about compilation - install dependencies and then compile the application using commands below:

sudo apt-get install git build-essential libtool libssl-dev pkg-config

cd ~/Downloads
git clone https://github.com/facebook/watchman.git -b v4.9.0 --depth 1
cd watchman
./autogen.sh
./configure --without-python --without-pcre --enable-lenient
make -j$(nproc)
sudo make install
1
  • Thanks for your reply. In reading the Watchman guide I had misunderstood. I had come to believe that the only way to install a binary release was by this approach facebook.github.io/watchman/docs/install.html#linux-and-macos (rather than just using apt). When I tried that approach it gave me problems, hence my attempts to install it manually. I have now used 'apt-get install watchman' and all seems to be well. Thanks again.
    – glaucon
    Nov 17, 2021 at 7:23
0

You can use these commands

sudo apt update

Then run

sudo apt -y install watchman

https://installati.one/ubuntu/20.04/watchman/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .