收藏
回答

为何miniprogram-ci 发布报错,无法使用?

 {"id":"50000020","message":"Error: file: comp.js\n require() of ES Module /root/.npm/_npx/a93b959afbcaed73/node_modules/baseline-browser-mapping/dist/index.js from /root/.npm/_npx/a93b959afbcaed73/node_modules/browserslist/index.js not supported.\nInstead change the require of /root/.npm/_npx/a93b959afbcaed73/node_modules/baseline-browser-mapping/dist/index.js in /root/.npm/_npx/a93b959afbcaed73/node_modules/browserslist/index.js to a dynamic import() which is available in all CommonJS modules.","status":"fail"}
[log] {"id":"50000021","message":"Error: file: comp.js\n require() of ES Module /root/.npm/_npx/a93b959afbcaed73/node_modules/baseline-browser-mapping/dist/index.js from /root/.npm/_npx/a93b959afbcaed73/node_modules/browserslist/index.js not supported.\nInstead change the require of /root/.npm/_npx/a93b959afbcaed73/node_modules/baseline-browser-mapping/dist/index.js in /root/.npm/_npx/a93b959afbcaed73/node_modules/browserslist/index.js to a dynamic import() which is available in all CommonJS modules.","status":"fail"}
child process stdout: runAllAsync error: CustomError: file: comp.js
 require() of ES Module /root/.npm/_npx/a93b959afbcaed73/node_modules/baseline-browser-mapping/dist/index.js from /root/.npm/_npx/a93b959afbcaed73/node_modules/browserslist/index.js not supported.
Instead change the require of /root/.npm/_npx/a93b959afbcaed73/node_modules/baseline-browser-mapping/dist/index.js in /root/.npm/_npx/a93b959afbcaed73/node_modules/browserslist/index.js to a dynamic import() which is available in all CommonJS modules.
    at enhance (/root/.npm/_npx/a93b959afbcaed73/node_modules/miniprogram-ci/dist/modules/corecompiler/summer/plugins/enhance.js:1:1579)
    at doTransform (/root/.npm/_npx/a93b959afbcaed73/node_modules/miniprogram-ci/dist/modules/corecompiler/summer/plugins/enhance.js:1:1827)
    at Object.runSummerPluginHook (/root/.npm/_npx/a93b959afbcaed73/node_modules/miniprogram-ci/dist/modules/corecompiler/summer/worker.js:1:1239) {
  code: 10045,
  plugin: 'summer-enhance',
  hook: 'transform',
  path: 'comp.js'
}

通过gitlab ci的构建提示以上错误
npx --yes miniprogram-ci upload \
        -r $ROBOT_NO --uv "$CI_COMMIT_BRANCH" --ud "$CI_COMMIT_MESSAGE" \
        --pp ./web_resv/dist \
        --appid xxxx \
        --pkp ./web_resv/config/private.xxx.key \
        --enable-es6 true

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

2 个回答

  • 张晨  🔆
    张晨 🔆
    2025-09-15

    npm包的autoprefixer的依赖browserslist latest 不支持低版本的node。

    可以自己尝试锁定一下

      "name": "browserslist",

      "version": "4.24.4",

    或是使用基于2.1.27的 2.1.28

    2025-09-15
    有用 1
    回复 1
  • +
    +
    2025-09-15

    有用...

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