这边也提供其一位博主遇到的情况:https://www.jianshu.com/p/dec3d1504cc9 

下面是我碰到的情况:

当我想引入LinearGradient时,

我执行了 npm install react-native-linear-gradient --save 下载该包

然后我执行了 react-native link 软连接

npm start启动服务时,发现react native环境跑不起来,终端报

Error: `fsevents` unavailable (this watcher can only be used on Darwin)

后面查找到原因watchman版本过旧或者错误,重新安装了watchman

npm r -g watchman
brew install watchman

重新运行npm start 后,发现,又报错,lodash 不存在,我删除了整个node_modules包,并且重新安装,再次启动服务,ok解决了

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐