创建项目时候Taro版本与运行项目的版本不一致会报错如下:
始编译项目 xxxx
错误 版本问题 Taro CLI 与本地安装运行时框架 @tarojs/taro-h5 版本不一致, 请确保版本一致!
提示 升级命令 升级到最新CLI:taro update self 升级到最新依赖库:taro update project
提示 升级文档 请参考 "常用 CLI 命令"中"更新" 章节:https://taro-docs.jd.com/taro/docs/GETTING-STARTED.html
Taro CLI:1.3.29 路径:/usr/local/lib/node_modules/@tarojs/cli/package.json
@tarojs/taro-h5:1.3.13 路径:/Users/peakchao/Code/Web/wechat-applet-app/node_modules/@tarojs/taro-h5/package.json
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wechat-applet-app@1.0.0 build:h5: `taro build --type h5 "--watch"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wechat-applet-app@1.0.0 build:h5 script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/peakchao/.npm/_logs/2019-12-17T08_58_48_783Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wechat-applet-app@1.0.0 dev:h5: `npm run build:h5 -- --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wechat-applet-app@1.0.0 dev:h5 script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/peakchao/.npm/_logs/2019-12-17T08_58_48_799Z-debug.log
删除当前Taro版本,并重新安装指定版本:
cd /usr/local/lib/node_modules
rm -rf \@tarojs/
#安装指定版本
npm install -g @tarojs/cli@1.3.13
npm install -g @tarojs/cli@1.3.29