收藏
回答

miniprogram-cli预览报错

框架类型 问题类型 操作系统 工具版本
小游戏 需求 Windows 1.05.2204250

直接抄文档中的例子,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



回答关注问题邀请回答
收藏

1 个回答

  • 吕小强
    吕小强
    01-15

    我也遇到这个问题了

    01-15
    有用
    回复
登录 后发表内容