Xcode啟動RN報錯"`fsevents` unavailable"

淺夏晴空發表於2021-11-30

fsevents unavailable

macOS fsevents unavailable (this watcher can only be used on Darwin)

安裝檔案監聽

清除本地原有的watchman
npm r -g watchman 
英特爾MAC 安裝
brew install watchman 
M1晶片 安裝
arch -arm64 brew install watchman  

如果失敗還可以使用如下命令 官網

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

安裝時又有如下錯誤

Error: Failure while executing; `tar --extract --no-same-owner --file /Users/xxxx/Library/Caches/Homebrew/downloads/f839b337f0ac1b367e2bdd72123940432a73834db77556858cefb671c2471aba--brotli-1.0.9.big_sur.bottle.tar.gz --directory /private/tmp/d20210623-7058-5w61ky` exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/xxxx/Library/Caches/Homebrew/downloads/f839b337f0ac1b367e2bdd72123940432a73834db77556858cefb671c2471aba--brotli-1.0.9.big_sur.bottle.tar.gz'

替換homebrew-bottles

如果使用的bash終端
vim ~/.bash_profile
新增配置
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
source ~/.bash_profile

#如果使用的是zsh
vim ~/.zshrc
#新增配置
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
source ~/.zshrc

#配置完重新執行 brew install watchman

clone Homebrew失敗

還有一種情況brew install watchman是clone Homebrew那個可以開啟GitHub的https://github.com/Homebrew手動進入目錄clone相關依賴包

#找到自己本地相關的目錄地址 進入
cd /usr/local/Homebrew/Library/Taps/homebrew
#clone一下兩個依賴包即可
git clone https://github.com/Homebrew/homebrew-cask
git clone https://github.com/Homebrew/homebrew-core.git

全域性安裝fsevents

yarn global add fsevents

brew link報錯

An unexpected error occurred during the brew link step The formula built, but is not symlinked into /usr/local Permission denied @ dir_s_mkdir - /usr/local/Frameworks

變更檔案許可權

sudo chown -R $(whoami):admin /usr/local/*

相關文章