react native 升级后 运行不起来

高高兴兴升级了RN,却发现运行不起来

确认build文件配置

第一步:

image.png

第二步:


image.png

第三步:


image.png

确认node,npm,watchman最新

node,npm

# 先安装模块n
npm install n -g
# 将 node 升级到最新稳定版
n stable

# 将 npm 升级到最新版
npm install npm -g
# 如果要指定版本,可以通过@指定版本
# npm install npm@3.10.10 -g 

#watchman
npm r -g watchman
brew install watchman

现在出现运行一下就好了,不用改代码真好

可能遇到对错误

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

react native环境跑不起来,终端报

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

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

npm r -g watchman
brew install watchman

如果你不幸运,遇到权限问题导致安装无法成功,可以尝试卸载后重装

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

xcode-select 安装失败

不要慌,百度一下发现解决方法全是执行如下指令:

xcode-select --install

但是有时执行该指令时会遇到如下问题:

不能安装该软件,因为当前无法从软件更新服务器获得。

这个时候也不要慌,直接去developer.apple.com下载就好了。
进去选择自己版本相应的Command Line Tools,下载安装就ok了。


image.png

小礼物走一走,来简书关注我

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容