Skip to content

Commit 8f8ae32

Browse files
committed
chore: update preinstall-deps
1 parent a9cb91a commit 8f8ae32

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

scripts/preinstall-deps.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,15 @@ async function installUv() {
228228
const uvPath = path.join(BIN_DIR, process.platform === 'win32' ? 'uv.exe' : 'uv');
229229

230230
if (fs.existsSync(uvPath)) {
231-
console.log('✅ uv already installed');
232-
return uvPath;
231+
// Verify the binary actually works (correct architecture)
232+
try {
233+
execSync(`"${uvPath}" --version`, { stdio: 'pipe' });
234+
console.log('✅ uv already installed');
235+
return uvPath;
236+
} catch (e) {
237+
console.log('⚠️ Existing uv binary is invalid or wrong architecture, removing...');
238+
fs.unlinkSync(uvPath);
239+
}
233240
}
234241

235242
// Check manual path
@@ -407,8 +414,15 @@ async function installBun() {
407414
const bunPath = path.join(BIN_DIR, platform === 'win32' ? 'bun.exe' : 'bun');
408415

409416
if (fs.existsSync(bunPath)) {
410-
console.log('✅ bun already installed');
411-
return bunPath;
417+
// Verify the binary actually works (correct architecture)
418+
try {
419+
execSync(`"${bunPath}" --version`, { stdio: 'pipe' });
420+
console.log('✅ bun already installed');
421+
return bunPath;
422+
} catch (e) {
423+
console.log('⚠️ Existing bun binary is invalid or wrong architecture, removing...');
424+
fs.unlinkSync(bunPath);
425+
}
412426
}
413427

414428
// Check manual path

0 commit comments

Comments
 (0)