收藏
回答

miniprogram-ci preview 上传代码报错

测试了一下npm包的版本均有问题。

miniprogram-ci@2.0.6

miniprogram-ci@2.0.4

miniprogram-ci@1.9.16

miniprogram-ci@1.9.8

配置如下:

          miniprogram-ci preview \

            -v false \

            --pp ./dist \

            --pkp ./private-key.txt \

            --enable-es6 true \

            --enable-es7 true \

            --enable-minify true \

            --enable-allowIgnoreUnusedFiles true \

            --enable-autoprefixwxss true \

            --uv ***** \

            --ud ***** \

            --appid ***** \

            -r 1

上周五还能用,今天周一我们公司所有的小程序CI全部异常。

之后测试回复说明已修复版本

项目使用: ts

miniprogram-ci 1.9.17

{
  type: 'SummerError',
  message: "TypeError: Cannot read properties of undefined (reading 'close')",
  stack: "TypeError: Cannot read properties of undefined (reading 'close')\n" +
    '    at Object.<anonymous> (/usr/local/bin/global/5/.pnpm/node_modules/chalk/index.js:72:75)\n' +
    '    at Module._compile (node:internal/modules/cjs/loader:1159:14)\n' +
    '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' +
    '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' +
    '    at Module._load (node:internal/modules/cjs/loader:878:12)\n' +
    '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' +
    '    at require (node:internal/modules/cjs/helpers:103:18)\n' +
    '    at Object.<anonymous> (/usr/local/bin/global/5/.pnpm/miniprogram-ci@1.9.17_eslint@8.57.0/node_modules/@babel/highlight/lib/index.js:10:15)\n' +
    '    at Module._compile (node:internal/modules/cjs/loader:1159:14)\n' +
    '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)',
  code: 10046,
  path: 'miniprogram/api/account.ts',
  plugin: 'summer-typescript',
  hook: 'load'
}

miniprogram-ci 2.0.8

child process stderr: getAppJSON error Error: miniprogram/app.json: ["pages"][0] could not find the corresponding file: "pages/index/index.js"
    at throwError (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/utils/common.js:1:1102)
    at checkPageExist (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/app/checkAppFields.js:1:1534)
    at checkMainPkgPages (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/app/checkAppFields.js:1:6047)
    at checkAppJSON (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/app/appJSON.js:1:2372)
    at /usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/app/appJSON.js:1:4242
    at i.scheduler (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/reactiveCache.js:1:1702)
    at reactiveEffect (/usr/local/bin/global/5/.pnpm/@vue+reactivity@3.0.5/node_modules/@vue/reactivity/dist/reactivity.cjs.js:46:24)
    at effect (/usr/local/bin/global/5/.pnpm/@vue+reactivity@3.0.5/node_modules/@vue/reactivity/dist/reactivity.cjs.js:21:9)
    at ReactiveJSONCompiler.registerOrGet (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/reactiveCache.js:1:1682)
    at /usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/reactiveCache.js:1:3413 {
  code: 10005,
  path: 'miniprogram/app.json'
}

CustomError: miniprogram/app.json: ["pages"][0] could not find the corresponding file: "pages/index/index.js"
    at throwError (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/utils/common.js:1:1102)
    at checkPageExist (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/app/checkAppFields.js:1:1534)
    at checkMainPkgPages (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/app/checkAppFields.js:1:6047)
    at checkAppJSON (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/app/appJSON.js:1:2372)
    at /usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/app/appJSON.js:1:4242
    at i.scheduler (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/reactiveCache.js:1:1702)
    at reactiveEffect (/usr/local/bin/global/5/.pnpm/@vue+reactivity@3.0.5/node_modules/@vue/reactivity/dist/reactivity.cjs.js:46:24)
    at effect (/usr/local/bin/global/5/.pnpm/@vue+reactivity@3.0.5/node_modules/@vue/reactivity/dist/reactivity.cjs.js:21:9)
    at ReactiveJSONCompiler.registerOrGet (/usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/reactiveCache.js:1:1682)
    at /usr/local/bin/global/5/.pnpm/miniprogram-ci@2.0.8_eslint@8.57.0/node_modules/miniprogram-ci/dist/modules/corecompiler/original/json/reactiveCache.js:1:3413 {
  code: 10005,
  path: 'miniprogram/app.json'
}

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

1 个回答

  • 社区技术运营专员-Jahozheng
    社区技术运营专员-Jahozheng
    08-02

    babel的node_modules依赖发版导致的。

    2.0.8

    1.9.17

    锁定了babel的子版本。PS:清除本地的node_modules和lock文件


    08-02
    有用
    回复 2
    • h.jamie
      h.jamie
      08-05
      pnpm i -g miniprogram-ci 还会有同样问题,使用 npm 则正常,主要原因是 chalk 和 ansi-styles 依赖版本冲突的问题,建议进一步修复
      08-05
      回复
    • 社区技术运营专员-Jahozheng
      社区技术运营专员-Jahozheng
      08-06回复h.jamie
      这个是pnpm的问题,我们无法修复 pnpm中 chalk 和 ansi-styles 依赖版本冲突的问题
      08-06
      回复
登录 后发表内容