./autogen 无法在 Ubuntu 上为 react-native 安装 watchman

./autogen 无法在 Ubuntu 上为 react-native 安装 watchman

我正在尝试在 Ubuntu 17.10 中安装 watchman,以便npm run android在命令行中运行以在终端中运行 React-Native。

我努力了sudo apt-get install -y autoconf automake build-essential python-dev

然后当我运行时./autogen.sh,它会引发这个错误:

./autogen.sh 
pkg-config appears to be missing (not available to autoconf tools)
please install the pkg-config package for your system.

答案1

遇到了类似的问题,结果发现我缺少一些二进制文件,需要以 root 身份运行 watchman 脚本。下面是一个简短的脚本,我用它来让一切正常运行:

# install watchman
sudo apt install -y libssl-dev autoconf automake libtool build-essential python-dev
cd $HOME
git clone https://github.com/facebook/watchman.git
cd watchman
git checkout v4.9.0  # the latest stable release
sudo ./autogen.sh
sudo ./configure
sudo make
sudo make install

# linux specific watchman configs
watchman --version
# increasing the watcher limits (need to do every time machine starts up)
echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && \
echo 999999 | sudo tee -a  /proc/sys/fs/inotify/max_queued_events && \
echo 999999 | sudo tee  -a /proc/sys/fs/inotify/max_user_instances && \
# restart server
watchman shutdown-server

答案2

我也有类似的问题。我安装了 pkg-config,然后问题就解决了。

sudo apt install pkg-config

输入 Y 或 y 接受安装

相关内容