收藏
回答

使用miniprogram-ci多次上传的问题?同样的代码有时候有问题有时候没有问题

miniprogram-ci版本: 2.0.10 node版本:20.11.1

会报的问题:

1.app.json: ["pages"][0] could not find the corresponding file: "pages/***.wxml"等文件找不到 其实文件是存在的,有时候可以部署成功

2.Cannot destructure property 'setting' of 'r' as it is undefined. 重启node服务后重试正常

代码示例:

A.js文件

const ci = require('miniprogram-ci');

ci.proxy(config.getConfig('PROXY_INFO')); //设置代理

router.post('/upload', function(req, res, next) {

  (async () => {

    codeService.uploadCode(ci, 参数);

  })();

  res.json(response.success());

});

========================codeService.js如下

const project = new ci.Project({

        appid: appid,

        type: 'miniProgram',

        projectPath: codePath,

        privateKeyPath: keyPath,

        ignores: ['node_modules/**/*']

    })

    await ci.upload({

        project,

        version: codeVersion,

        desc: codeDesc,

        setting: {

            es6: true,

            minify: true

        },

        onProgressUpdate: console.log,

        robot: 6

    }).then(resp => {

        ...

    }).catch(error => {

        ...

    });

感觉CI组件有缓存,可又没法清理,该怎么解决?


回答关注问题邀请回答
收藏
登录 后发表内容