在 Ubuntu 20.04 上安装 Watchman 时出错

在 Ubuntu 20.04 上安装 Watchman 时出错

尝试在全新安装的 Ubuntu 20.04 上安装 Watchman for React Native。

我正在使用以下步骤(但如果有更好的方法 - 或者如果您可以完全避免使用 Watchman,我会很感兴趣)...

  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

我在“make”步骤中收到下面显示的错误。

我见过数字 问题与建筑守望者有关,但我还没有见过这种情况。

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

只需安装相同的 watchman 4.9.0包裹从官方存储库使用以下命令(也许可以咨询官方指南):

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

如果您仍然确定编译 - 安装依赖项,然后使用以下命令编译应用程序:

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

答案2

您可以使用这些命令

sudo apt update

然后运行

sudo apt -y install watchman

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

相关内容