macOS 10.12系统下使用Homebrew安装Watchman失败求助
Hey there, I totally get how frustrating this is—old macOS versions can throw a wrench in modern dev tooling setups. Let’s walk through a few practical solutions to get Watchman installed on your 2012 MacBook Pro running macOS 10.12.
Option 1: Install an Older, Compatible Version of Homebrew + Watchman
Homebrew’s latest releases dropped support for macOS 10.12, so we need to roll back to a version that still works with your system:
Uninstall your current Homebrew (if you have it)
Run this command in Terminal to remove the modern, unsupported Homebrew:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"Install a Homebrew version compatible with macOS 10.12
Version 2.2.0 is known to work with Sierra. Use this command to install it:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/2.2.0/install.sh)"Install an older Watchman version that supports 10.12
Newer Watchman builds won’t run on 10.12, so install a legacy version like 4.9.0:brew install watchman@4.9.0Link the legacy Watchman (optional but recommended)
Make sure the older version is available in your PATH:brew link --force watchman@4.9.0
Option 2: Manually Compile Watchman from Source
If Homebrew still gives you trouble, compiling from source is a reliable fallback:
Install Xcode 8.3.3 (critical for macOS 10.12)
macOS 10.12 only supports up to Xcode 8.3.3. Download it from Apple’s Developer portal (you’ll need to sign in with an Apple ID).Install Xcode Command Line Tools
Open Terminal and run:xcode-select --installFollow the prompts to complete the installation.
Clone and build a compatible Watchman version
- Clone the Watchman repo:
git clone https://github.com/facebook/watchman.git - Navigate into the repo and check out a version that works with 10.12:
cd watchman git checkout v4.9.0 - Compile and install:
./autogen.sh && ./configure && make && sudo make install
- Clone the Watchman repo:
Option 3: Upgrade macOS to High Sierra (10.13)
Your 2012 MacBook Pro can actually be upgraded to macOS High Sierra (10.13), which has better Homebrew support. Here’s how:
Back up your data first
Use Time Machine to back up all your files—always safe to have a backup before upgrading.Download macOS High Sierra
You can find the installation package on Apple’s official support site or via the App Store (search for "macOS High Sierra").Run the installer
Follow the on-screen instructions to upgrade your system. Once done, you can install the latest Homebrew and Watchman normally with:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install watchman
A Quick Note
Keep in mind that older software versions might have security vulnerabilities, but if you’re stuck on macOS 10.12 for hardware or app compatibility reasons, the first two options should get you up and running with React Native development.
内容的提问来源于stack exchange,提问作者Ali Barznji

