react-native項目啟動報錯——watchman安裝問題(mac pro)


啟動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)"

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM