fix(napi): do not invoke process.report on Windows (#2972)

This commit is contained in:
LongYinan 2025-10-23 14:18:30 +08:00 committed by GitHub
parent 694db41895
commit 01485ff423
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ function requireNative() {
}
} else if (process.platform === 'win32') {
if (process.arch === 'x64') {
if (process.report?.getReport?.()?.header?.osName?.startsWith?.('MINGW')) {
if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
${requireTuple('win32-x64-gnu')}
} else {
${requireTuple('win32-x64-msvc')}

View File

@ -108,7 +108,7 @@ function requireNative() {
}
} else if (process.platform === 'win32') {
if (process.arch === 'x64') {
if (process.report?.getReport?.()?.header?.osName?.startsWith?.('MINGW')) {
if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
try {
return require('./example.win32-x64-gnu.node')
} catch (e) {