Skip to content

Commit cab3113

Browse files
authored
fix(npm): handle unhandled promise rejection in binary download (#12261)
Update install.ts
1 parent 1b115d8 commit cab3113

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

npm/src/install.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ if (!PLATFORM_SPECIFIC_PACKAGE_NAME)
228228
// Skip downloading the binary if it was already installed via optionalDependencies
229229
if (!isPlatformSpecificPackageInstalled()) {
230230
console.log('Platform specific package not found. Will manually download binary.')
231-
downloadBinaryFromRegistry()
231+
downloadBinaryFromRegistry().catch(error => {
232+
console.error(colors.red, 'Failed to download binary:', error, colors.reset)
233+
process.exitCode = 1
234+
})
232235
} else {
233236
console.log('Platform specific package already installed. Skipping manual download.')
234237
}

0 commit comments

Comments
 (0)