fix: use correct npm bin in subprocs
MODIFY
lib/cli/npm.js
lib/cli/npm.js
@@ -2,7 +2,7 @@ import _ from 'lodash';
import path from 'path';
import semver from 'semver';
import { exec } from 'teen_process';
-import { mkdirp, util } from 'appium-support';
+import { mkdirp, util, system } from 'appium-support';
const INSTALL_LOCKFILE = '.appium.install.lock';
const LINK_LOCKFILE = '.appium.link.lock';
@@ -28,7 +28,8 @@ export default class NPM {
if (json) {
args.push('-json');
}
- let runner = async () => await exec('npm', args, execOpts);
+ const npmCmd = system.isWindows() ? 'npm.cmd' : 'npm';
+ let runner = async () => await exec(npmCmd, args, execOpts);
if (lockFile) {
const acquireLock = util.getLockFileGuard(path.resolve(cwd, lockFile));
const _runner = runner;

fix: use correct npm bin in subprocs