(err)
| 579 | } |
| 580 | |
| 581 | function printSpawnFailure(err) { |
| 582 | resetTerminal() |
| 583 | const code = err && err.code ? ` (${err.code})` : '' |
| 584 | |
| 585 | console.error(`Failed to start ${packageName}: ${err.message}${code}`) |
| 586 | console.error('') |
| 587 | console.error('System info:') |
| 588 | console.error(` Platform: ${process.platform} ${process.arch}`) |
| 589 | console.error(` Node: ${process.version}`) |
| 590 | console.error(` Binary: ${CONFIG.binaryPath}`) |
| 591 | console.error(` Exists: ${getInstalledBinaryStatus()}`) |
| 592 | |
| 593 | if (process.platform === 'win32') { |
| 594 | console.error('') |
| 595 | console.error( |
| 596 | 'On Windows, this can happen when Windows Security or antivirus blocks', |
| 597 | ) |
| 598 | console.error( |
| 599 | 'or quarantines the downloaded executable, or when the binary requires', |
| 600 | ) |
| 601 | console.error('CPU instructions that are not available on this machine.') |
| 602 | } |
| 603 | |
| 604 | console.error('') |
| 605 | console.error('Try deleting the downloaded files and running again:') |
| 606 | console.error(` ${CONFIG.configDir}`) |
| 607 | console.error('') |
| 608 | } |
| 609 | |
| 610 | function spawnInstalledBinary(options = {}) { |
| 611 | if (!fs.existsSync(CONFIG.binaryPath)) { |
no test coverage detected