更新
Taro 提供了更新命令来更新 CLI 工具自身和项目中 Taro 相关的依赖
更新 Taro CLI 工具
-
# taro
-
$ taro update self
-
# npm
-
npm i -g @tarojs/cli@latest
-
# yarn
-
yarn global add @tarojs/cli@latest
更新项目中 Taro 相关的依
$ taro update project
还会报一下错误
taro Cannot read property 'css' of undefined
![](https://img2018.cnblogs.com/blog/857884/201909/857884-20190921235545656-175682913.jpg)
看着报错信息: 安装缺少的包
![](https://img2018.cnblogs.com/blog/857884/201909/857884-20190921235609258-1946241466.jpg)
报错信息
![](https://img2018.cnblogs.com/blog/857884/201909/857884-20190921235707596-326086324.jpg)
更新npm
![](https://img2018.cnblogs.com/blog/857884/201909/857884-20190921235738515-1033209206.jpg)
mac --- command+T 重新打开终端新标签 重启项目就可以了
-------------------------------------
npm cache clean --force
参考链接:
npm view indicative versions
https://blog.csdn.net/weixin_34409741/article/details/86134748
https://segmentfault.com/q/1010000017932421