| 86 | /The requested module '([^']+)' does not provide an export named '([^']+)'/; |
| 87 | |
| 88 | const firstMeaningfulLine = (stderr: string): string => { |
| 89 | const lines = stderr |
| 90 | .split("\n") |
| 91 | .map((line) => line.trim()) |
| 92 | .filter(Boolean); |
| 93 | const errorLine = lines.find((line) => /^(\w*Error|Cannot find)/i.test(line)); |
| 94 | if (errorLine) return errorLine; |
| 95 | for (const line of lines) { |
| 96 | if (line.startsWith("node:")) continue; |
| 97 | if (line.startsWith("file://")) continue; |
| 98 | if (line.startsWith("at ")) continue; |
| 99 | if (line.startsWith("import ")) continue; |
| 100 | if (line.startsWith("throw ")) continue; |
| 101 | if (line === "^" || /^\^+$/.test(line)) continue; |
| 102 | return line; |
| 103 | } |
| 104 | return lines[0] ?? "(no stderr)"; |
| 105 | }; |
| 106 | |
| 107 | type Tarballs = ReadonlyMap<string, string>; |
| 108 | |