From 566a1192bc1f0e8f8fa27b40d155b717e6134904 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 5 Oct 2025 07:39:25 +0000 Subject: [PATCH 1/3] Initial plan From ae1cd7174e71aa38f91e125e3d5cefe330145a40 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 5 Oct 2025 07:45:47 +0000 Subject: [PATCH 2/3] Add stderr output to npm pack and other executeCommand calls for better debugging Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com> --- build/tests/integration/lib/adapterSetup.js | 14 ++++++++++++-- build/tests/integration/lib/controllerSetup.js | 8 +++++++- src/tests/integration/lib/adapterSetup.ts | 14 ++++++++++++-- src/tests/integration/lib/controllerSetup.ts | 8 +++++++- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/build/tests/integration/lib/adapterSetup.js b/build/tests/integration/lib/adapterSetup.js index 0744efd..26b51e5 100644 --- a/build/tests/integration/lib/adapterSetup.js +++ b/build/tests/integration/lib/adapterSetup.js @@ -75,9 +75,13 @@ class AdapterSetup { // Therefore pack it into a tarball and put it in the test dir for installation const packResult = await (0, executeCommand_1.executeCommand)('npm', ['pack', '--loglevel', 'silent'], { stdout: 'pipe', + stderr: 'pipe', }); if (packResult.exitCode !== 0 || typeof packResult.stdout !== 'string') { - throw new Error(`Packing the adapter tarball failed!`); + const errorMessage = packResult.stderr + ? `Packing the adapter tarball failed!\nstderr: ${packResult.stderr}` + : `Packing the adapter tarball failed!`; + throw new Error(errorMessage); } // The last non-empty line of `npm pack`s STDOUT contains the tarball path const stdoutLines = packResult.stdout.trim().split(/[\r\n]+/); @@ -92,6 +96,7 @@ class AdapterSetup { debug('Removing the adapter from package-lock.json'); await (0, executeCommand_1.executeCommand)('npm', ['uninstall', this.adapterFullName, '--package-lock-only', '--omit=dev'], { cwd: this.testDir, + stderr: 'pipe', }); // Complete the package.json, so npm can do it's magic debug('Saving the adapter in package.json'); @@ -114,6 +119,7 @@ class AdapterSetup { // Defer to npm to install the controller (if it wasn't already) await (0, executeCommand_1.executeCommand)('npm', ['i', '--omit=dev'], { cwd: this.testDir, + stderr: 'pipe', }); debug(' => done!'); } @@ -126,9 +132,13 @@ class AdapterSetup { const addResult = await (0, executeCommand_1.executeCommand)('node', [`${this.appName}.js`, 'add', this.adapterName, '--enabled', 'false'], { cwd: this.testControllerDir, stdout: 'ignore', + stderr: 'pipe', }); if (addResult.exitCode !== 0) { - throw new Error(`Adding the adapter instance failed!`); + const errorMessage = addResult.stderr + ? `Adding the adapter instance failed!\nstderr: ${addResult.stderr}` + : `Adding the adapter instance failed!`; + throw new Error(errorMessage); } debug(' => done!'); } diff --git a/build/tests/integration/lib/controllerSetup.js b/build/tests/integration/lib/controllerSetup.js index 005ea94..c9aa08c 100644 --- a/build/tests/integration/lib/controllerSetup.js +++ b/build/tests/integration/lib/controllerSetup.js @@ -102,6 +102,7 @@ class ControllerSetup { debug('(Re-)installing JS Controller...'); await (0, executeCommand_1.executeCommand)('npm', ['i', '--omit=dev'], { cwd: this.testDir, + stderr: 'pipe', }); // Prepare/clean the databases and config if (wasJsControllerInstalled) { @@ -182,13 +183,18 @@ class ControllerSetup { await (0, executeCommand_1.executeCommand)('node', [`${this.appName}.js`, 'stop'], { cwd: this.testControllerDir, stdout: 'ignore', + stderr: 'pipe', }); const setupResult = await (0, executeCommand_1.executeCommand)('node', [`${this.appName}.js`, 'setup', 'first', '--console'], { cwd: this.testControllerDir, stdout: 'ignore', + stderr: 'pipe', }); if (setupResult.exitCode !== 0) { - throw new Error(`${this.appName} setup first failed!`); + const errorMessage = setupResult.stderr + ? `${this.appName} setup first failed!\nstderr: ${setupResult.stderr}` + : `${this.appName} setup first failed!`; + throw new Error(errorMessage); } debug(' => done!'); } diff --git a/src/tests/integration/lib/adapterSetup.ts b/src/tests/integration/lib/adapterSetup.ts index 86cb2d7..1d1b226 100644 --- a/src/tests/integration/lib/adapterSetup.ts +++ b/src/tests/integration/lib/adapterSetup.ts @@ -50,9 +50,13 @@ export class AdapterSetup { // Therefore pack it into a tarball and put it in the test dir for installation const packResult = await executeCommand('npm', ['pack', '--loglevel', 'silent'], { stdout: 'pipe', + stderr: 'pipe', }); if (packResult.exitCode !== 0 || typeof packResult.stdout !== 'string') { - throw new Error(`Packing the adapter tarball failed!`); + const errorMessage = packResult.stderr + ? `Packing the adapter tarball failed!\nstderr: ${packResult.stderr}` + : `Packing the adapter tarball failed!`; + throw new Error(errorMessage); } // The last non-empty line of `npm pack`s STDOUT contains the tarball path @@ -69,6 +73,7 @@ export class AdapterSetup { debug('Removing the adapter from package-lock.json'); await executeCommand('npm', ['uninstall', this.adapterFullName, '--package-lock-only', '--omit=dev'], { cwd: this.testDir, + stderr: 'pipe', }); // Complete the package.json, so npm can do it's magic @@ -94,6 +99,7 @@ export class AdapterSetup { // Defer to npm to install the controller (if it wasn't already) await executeCommand('npm', ['i', '--omit=dev'], { cwd: this.testDir, + stderr: 'pipe', }); debug(' => done!'); @@ -112,10 +118,14 @@ export class AdapterSetup { { cwd: this.testControllerDir, stdout: 'ignore', + stderr: 'pipe', }, ); if (addResult.exitCode !== 0) { - throw new Error(`Adding the adapter instance failed!`); + const errorMessage = addResult.stderr + ? `Adding the adapter instance failed!\nstderr: ${addResult.stderr}` + : `Adding the adapter instance failed!`; + throw new Error(errorMessage); } debug(' => done!'); } diff --git a/src/tests/integration/lib/controllerSetup.ts b/src/tests/integration/lib/controllerSetup.ts index 0848fab..94c2fa6 100644 --- a/src/tests/integration/lib/controllerSetup.ts +++ b/src/tests/integration/lib/controllerSetup.ts @@ -80,6 +80,7 @@ export class ControllerSetup { debug('(Re-)installing JS Controller...'); await executeCommand('npm', ['i', '--omit=dev'], { cwd: this.testDir, + stderr: 'pipe', }); // Prepare/clean the databases and config if (wasJsControllerInstalled) { @@ -167,14 +168,19 @@ export class ControllerSetup { await executeCommand('node', [`${this.appName}.js`, 'stop'], { cwd: this.testControllerDir, stdout: 'ignore', + stderr: 'pipe', }); const setupResult = await executeCommand('node', [`${this.appName}.js`, 'setup', 'first', '--console'], { cwd: this.testControllerDir, stdout: 'ignore', + stderr: 'pipe', }); if (setupResult.exitCode !== 0) { - throw new Error(`${this.appName} setup first failed!`); + const errorMessage = setupResult.stderr + ? `${this.appName} setup first failed!\nstderr: ${setupResult.stderr}` + : `${this.appName} setup first failed!`; + throw new Error(errorMessage); } debug(' => done!'); } From c846d855098e0311bee04a05b7193903c47e3d3f Mon Sep 17 00:00:00 2001 From: Ingo Fischer Date: Sun, 12 Oct 2025 14:12:34 +0200 Subject: [PATCH 3/3] Update CHANGELOG with npm error logging feature Added a log for npm and installation errors to improve debugging. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a7c6a2..51cf692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ PLACEHOLDER for the next version: ## **WORK IN PROGRESS** --> +## **WORK IN PROGRESS** +* (@Apollon77/@copilot) Logs npm and installation errors to console for easier debugging + ## 5.1.1 (2025-08-31) * (@Apollon77) Downgrades chai-as-promised type dependency to same major as main dependency