0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-20 22:12:38 -05:00

Improve astro add deps error reporting (#9593)

This commit is contained in:
Bjorn Lu 2024-01-04 19:16:53 +08:00 committed by GitHub
parent 82bad5d620
commit 3b4e629ac8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
"astro": patch
---
Improves `astro add` error reporting when the dependencies fail to install

View file

@ -732,11 +732,12 @@ async function tryToInstallIntegrations({
);
spinner.succeed();
return UpdateResult.updated;
} catch (err) {
} catch (err: any) {
spinner.fail();
logger.debug('add', 'Error installing dependencies', err);
// NOTE: `err.stdout` can be an empty string, so log the full error instead for a more helpful log
// eslint-disable-next-line no-console
console.error('\n', (err as any).stdout, '\n');
console.error('\n', err.stdout || err.message, '\n');
return UpdateResult.failure;
}
} else {