Skip to content

Commit 1e3014b

Browse files
authored
fix: install-npm.js fails to run npm run build due to type error (#292)
1 parent 2c4c144 commit 1e3014b

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

install-npm.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
const B = require('bluebird');
13+
const util = require('util');
1314

1415
// this is here because we're using async/await, and this must be set _before_ we use async/await,
1516
// given that bluebird is used elsewhere via `doInstall()`.
@@ -31,13 +32,15 @@ async function main() {
3132
try {
3233
await fs.stat(BUILD_PATH);
3334
} catch {
34-
log.info(`The Chromedriver install script cannot be found at '${BUILD_PATH}'. ` +
35-
`Building appium-chromedriver package`);
35+
log.info(
36+
`The Chromedriver install script cannot be found at '${BUILD_PATH}'. ` +
37+
`Building appium-chromedriver package`
38+
);
3639
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
3740
try {
3841
await exec(npmCommand, ['run', 'build'], {logger: log, cwd: __dirname});
3942
} catch (e) {
40-
throw new Error(`appium-chromedriver package cannot be built: ${e.stderr || e.message}`);
43+
throw new Error(`appium-chromedriver package cannot be built: ${util.inspect(e)}`);
4144
}
4245
}
4346

@@ -47,11 +50,9 @@ async function main() {
4750
!_.isEmpty(process.env.npm_config_chromedriver_skip_install)
4851
) {
4952
log.warn(
50-
`'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable is set; skipping Chromedriver installation.`,
51-
);
52-
log.warn(
53-
`Android web/hybrid testing will not be possible without Chromedriver.`,
53+
`'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable is set; skipping Chromedriver installation.`
5454
);
55+
log.warn(`Android web/hybrid testing will not be possible without Chromedriver.`);
5556
return;
5657
}
5758

@@ -62,7 +63,7 @@ async function main() {
6263
log.error(err.stack ? err.stack : err);
6364
log.error(
6465
`Downloading Chromedriver can be skipped by setting the` +
65-
`'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable.`,
66+
`'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable.`
6667
);
6768
process.exit(1);
6869
}

lib/utils.js

+3
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ const getOsInfo = _.memoize(
131131
}
132132
);
133133

134+
// @ts-expect-error
135+
// error TS2345: Argument of type '{}' is not assignable to parameter of type 'DriverOpts<Readonly<Record<string, Constraint>>>'
136+
// Type '{}' is missing the following properties from type 'ServerArgs': address, allowCors, allowInsecure, basePath, and 26 more.
134137
const getBaseDriverInstance = _.memoize(() => new BaseDriver({}, false));
135138

136139
/**

0 commit comments

Comments
 (0)