https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html
通过 pnpm 工具以命令 `pnpm install miniprogram-ci --save` 安装 miniprogram-ci 后,在调 ci.upload() 时,会报如下错误:
Error: dist/pages/party-building/index.js: undefined
at throwError (/var/lib/jenkins/workspace/wx-test/node_modules/.pnpm/miniprogram-ci@1.6.10/node_modules/miniprogram-ci/dist/utils/common.js:1:1103)
at f (/var/lib/jenkins/workspace/wx-test/node_modules/.pnpm/miniprogram-ci@1.6.10/node_modules/miniprogram-ci/dist/core/compile/handler/js.js:1:2541)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async compileJS (/var/lib/jenkins/workspace/wx-test/node_modules/.pnpm/miniprogram-ci@1.6.10/node_modules/miniprogram-ci/dist/core/compile/handler/js.js:1:2801)
at async Promise.all (index 6)
at async compileJSFiles (/var/lib/jenkins/workspace/wx-test/node_modules/.pnpm/miniprogram-ci@1.6.10/node_modules/miniprogram-ci/dist/core/compile/common.js:1:2580)
at async compile (/var/lib/jenkins/workspace/wx-test/node_modules/.pnpm/miniprogram-ci@1.6.10/node_modules/miniprogram-ci/dist/core/compile/mini_program.js:1:2482)
at async innerUpload (/var/lib/jenkins/workspace/wx-test/node_modules/.pnpm/miniprogram-ci@1.6.10/node_modules/miniprogram-ci/dist/ci/upload.js:1:1796)
at async upload (/var/lib/jenkins/workspace/wx-test/node_modules/.pnpm/miniprogram-ci@1.6.10/node_modules/miniprogram-ci/dist/ci/upload.js:1:898)
at async Object.upload (/var/lib/jenkins/workspace/wx-test/node_modules/.pnpm/miniprogram-ci@1.6.10/node_modules/miniprogram-ci/dist/utils/report.js:1:1403) {
code: 10009,
path: 'dist/pages/party-building/index.js'
}
建议先添加个 .npmrc 文件,内容为
public-hoist-pattern[]=*
然后再 pnpm install
public-hoist-pattern[]=*ansi-styles*
public-hoist-pattern[]=*supports-color*
public-hoist-pattern[]=*has-flag*
2023年,现在全局通过 pnpm 安装 miniprogram-ci 仍然会出现各种依赖问题。希望能处理下🙏🏻
都 2024 了~
使用 https://www.npmjs.com/package/@tarojs/plugin-mini-ci 可以解决
pnpm install --shamefully-hoist 还是报错,楼主解决了吗
既然已经是 ci 了,用 pnpm 就加上 --shamefully-hoist --prod
指望官方主动去兼容是暂时没戏的,毕竟pnpm目前占有率还不高
这难道不是pnpm的问题?
和正常npm安装依赖的方式来比较,
pnpm没处理好miniprogram-ci的兼容