(err)
| 592 | } |
| 593 | |
| 594 | function printSpawnFailure(err) { |
| 595 | resetTerminal() |
| 596 | const code = err && err.code ? ` (${err.code})` : '' |
| 597 | |
| 598 | console.error(`Failed to start ${packageName}: ${err.message}${code}`) |
| 599 | console.error('') |
| 600 | console.error('System info:') |
| 601 | console.error(` Platform: ${process.platform} ${process.arch}`) |
| 602 | console.error(` Node: ${process.version}`) |
| 603 | console.error(` Binary: ${CONFIG.binaryPath}`) |
| 604 | console.error(` Exists: ${getInstalledBinaryStatus()}`) |
| 605 | |
| 606 | if (process.platform === 'win32') { |
| 607 | console.error('') |
| 608 | console.error( |
| 609 | 'On Windows, this can happen when Windows Security or antivirus blocks', |
| 610 | ) |
| 611 | console.error( |
| 612 | 'or quarantines the downloaded executable, or when the binary requires', |
| 613 | ) |
| 614 | console.error('CPU instructions that are not available on this machine.') |
| 615 | } |
| 616 | |
| 617 | console.error('') |
| 618 | console.error('Try deleting the downloaded files and running again:') |
| 619 | console.error(` ${CONFIG.configDir}`) |
| 620 | console.error('') |
| 621 | } |
| 622 | |
| 623 | function spawnInstalledBinary(options = {}) { |
| 624 | if (!fs.existsSync(CONFIG.binaryPath)) { |
no test coverage detected