@todoforai/edge 0.12.16 → 0.12.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49218,20 +49218,26 @@ function findFileRecursive(dir, names) {
|
|
|
49218
49218
|
return null;
|
|
49219
49219
|
}
|
|
49220
49220
|
function installWithNpm(name, pkg) {
|
|
49221
|
+
const TIMEOUT_MS = 120000;
|
|
49221
49222
|
log2("info", `Installing ${name} via npm (${pkg})`);
|
|
49222
49223
|
const result = spawnSync("npm", ["install", "--prefix", TOOLS_DIR, pkg], {
|
|
49223
49224
|
stdio: "pipe",
|
|
49224
|
-
timeout:
|
|
49225
|
+
timeout: TIMEOUT_MS,
|
|
49225
49226
|
shell: true
|
|
49226
49227
|
});
|
|
49228
|
+
const stderr = result.stderr?.toString().trim() || "";
|
|
49229
|
+
const stdout = result.stdout?.toString().trim() || "";
|
|
49227
49230
|
if (result.error) {
|
|
49228
|
-
throw new Error(`npm install failed: ${result.error.message}`);
|
|
49231
|
+
throw new Error(`npm install failed: ${result.error.message} | stderr: ${stderr || "(empty)"} | stdout: ${stdout || "(empty)"}`);
|
|
49229
49232
|
}
|
|
49230
49233
|
if (result.signal) {
|
|
49231
|
-
throw new Error(`npm install killed by ${result.signal}${result.signal === "SIGTERM" ?
|
|
49234
|
+
throw new Error(`npm install killed by ${result.signal}${result.signal === "SIGTERM" ? ` (likely timed out after ${TIMEOUT_MS / 1000}s)` : ""} | stderr: ${stderr || "(empty)"}`);
|
|
49235
|
+
}
|
|
49236
|
+
if (result.status === null) {
|
|
49237
|
+
throw new Error(`npm install: null exit code (likely timed out after ${TIMEOUT_MS / 1000}s on Windows, signal not propagated through cmd.exe) | stderr: ${stderr || "(empty)"} | stdout: ${stdout || "(empty)"}`);
|
|
49232
49238
|
}
|
|
49233
49239
|
if (result.status !== 0) {
|
|
49234
|
-
throw new Error(`npm install failed
|
|
49240
|
+
throw new Error(`npm install failed (exit ${result.status}) | stderr: ${stderr || "(empty)"} | stdout: ${stdout || "(empty)"}`);
|
|
49235
49241
|
}
|
|
49236
49242
|
}
|
|
49237
49243
|
function installWithPip(name, pkg) {
|