ci: improve packaging failure diagnostics

This commit is contained in:
lofyer
2026-08-04 16:15:57 +08:00
parent 4b42c1255e
commit dcaa28359c
2 changed files with 35 additions and 12 deletions
+7 -1
View File
@@ -96,13 +96,19 @@ async function downloadPackage(projectDir, packageName, integrity) {
{
cwd: projectDir,
encoding: 'utf8',
maxBuffer: 16 * 1024 * 1024,
shell: false,
windowsHide: true
}
)
if (result.status !== 0) {
throw new Error(
`Unable to fetch ${packageName}: ${result.stderr || result.stdout}`
`Unable to fetch ${packageName}: ${
result.error?.message ||
result.stderr ||
result.stdout ||
`npm exited with ${result.status}`
}`
)
}
const output = JSON.parse(result.stdout)