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:
parent
82bad5d620
commit
3b4e629ac8
2 changed files with 8 additions and 2 deletions
5
.changeset/afraid-socks-rescue.md
Normal file
5
.changeset/afraid-socks-rescue.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
Improves `astro add` error reporting when the dependencies fail to install
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue