啟動react-native腳手架和項目后報錯:
error: bundling failed: Error: `fsevents` unavailable (this watcher can only be used on Darwin)
原因分析:沒有正確安裝react-native依賴watchman
初次安裝使用的是
npm i watchman -g
安裝完會提示你npm 已經不支持watchman了,下載后的文件夾下只有package.json和readme.md兩個文件
所以這種方式安裝是不行的
成功安裝的方式是使用homebrew包管理工具下載安裝watchman
brew install watchman
當然前提是你需要先安裝homebrew軟件包管理工具,官網上提供的方法如下
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"