miniprogram-cli预览报错
直接抄文档中的例子,addid、type这些都该了 https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html Error: check-version.js: file: check-version.js
check-version.js: Unexpected token (5:31)
3 | const { version, SDKVersion, platform, system } = wx.getSystemInfoSync();
4 | const accountInfo = wx.getAccountInfoSync();
> 5 | const envVersion = accountInfo?.miniProgram?.envVersion;
| ^
6 | function compareVersion(v1, v2) {
7 | if (!v1 || !v2) {
8 | return false;
at throwError (C:\D\WorkSpace\NodeJs\minigame\node_modules\miniprogram-ci\dist\utils\common.js:2:1095)
at m (C:\D\WorkSpace\NodeJs\minigame\node_modules\miniprogram-ci\dist\core\compile\handler\js.js:2:2611)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async compileJS (C:\D\WorkSpace\NodeJs\minigame\node_modules\miniprogram-ci\dist\core\compile\handler\js.js:2:2871)
at async Promise.all (index 0)
at async compileJSFiles (C:\D\WorkSpace\NodeJs\minigame\node_modules\miniprogram-ci\dist\core\compile\common.js:2:2708)
at async compile (C:\D\WorkSpace\NodeJs\minigame\node_modules\miniprogram-ci\dist\core\compile\game.js:2:1448)
at async innerUpload (C:\D\WorkSpace\NodeJs\minigame\node_modules\miniprogram-ci\dist\ci\upload.js:2:1968)
at async preview (C:\D\WorkSpace\NodeJs\minigame\node_modules\miniprogram-ci\dist\ci\preview.js:2:965)
at async Object.preview (C:\D\WorkSpace\NodeJs\minigame\node_modules\miniprogram-ci\dist\utils\report.js:2:1403) {
code: 10032,
path: 'check-version.js'
}
Node.js v20.10.0