Skip to content

Commit e9a0b11

Browse files
Jay-Lokhandegiggio
authored andcommitted
Add RISC-V 64-bit support to install.js with custom error
Modify getPlatform to detect RISC-V (process.arch === 'riscv64') on Linux and check for --chromedriver_filepath. If not provided, exit with a custom error message informing users that no official binary exists and they must supply one. If provided, proceed using the filepath, enhancing compatibility for RISC-V systems.
1 parent 37ee8a5 commit e9a0b11

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

install.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,20 @@ class Installer {
9090
if (thePlatform === 'linux') {
9191
if (process.arch === 'arm64' || process.arch === 's390x' || process.arch === 'x64' || process.arch === 'riscv64') {
9292
return 'linux64';
93+
} else if (process.arch === 'riscv64') {
94+
// Check if --chromedriver_filepath is provided via env vars
95+
const configuredfilePath = process.env.npm_config_chromedriver_filepath || process.env.CHROME>
96+
if (!configuredfilePath) {
97+
console.error(
98+
'Error: RISC-V detected: No official Chromedriver binary is available for RISC-V 64-bit. >
99+
'Please provide a local Chromedriver binary using the --chromedriver_filepath option. ' +
100+
'Example: npm install chromedriver --chromedriver_filepath=/path/to/chromedriver ' +
101+
'You may need to build Chromedriver from source or obtain it from a third-party source.'
102+
);
103+
// process.exit(1);
104+
}
105+
// Return a placeholder platform; actual file will come from configuredfilePath
106+
return 'linux64'; // Compatible with downstream logic, though download is skipped
93107
} else {
94108
console.error('Only Linux 64 bits supported.');
95109
process.exit(1);

0 commit comments

Comments
 (0)