检查当前react本机CLI版本
react-native -v
react-native-cli: 1.0.0
react-native: 0.61.5我使用以下命令来升级全局react-native-cli版本
npm uninstall -g react-native-cli
npm install -g react-native-cli但是现在检查一下当前的react本机cli版本,它仍然是v1.0.0
react-native -v
react-native-cli: 1.0.0
react-native: 0.61.5如何升级react-native-cli
发布于 2021-07-26 17:50:47
--家庭酿造方式
如果需要的话,先从全局删除
npm uninstall -g react-native-cli或
yarn remove react-native-cli安装brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"用brew安装
brew install react-native-cli未来升级
brew upgrade react-native-cli发布于 2020-01-09 04:03:32
由于您使用的是react-native 0.61.5,所以您需要根据React的兼容性安装react-native-cli版本3.0.0或更高版本。
如果您已经安装了react-本机CLI的版本,请使用
npm uninstall -g react-native-cli然后尝试安装react本机CLI,如下所示,
npm install react-native-cli@3.0.0希望这能帮到你。
注意:可能不适用于react-native-cli版本4.0.0或更高版本。
https://stackoverflow.com/questions/59656797
复制相似问题