Skip to content

Commit cc00012

Browse files
committed
npm is not a real binary?
1 parent a0bb107 commit cc00012

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib_dev/process.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import * as child_process from "node:child_process";
22
import * as fs from "node:fs/promises";
33
import * as path from "node:path";
4+
import { execPath } from "node:process";
45
import { bsc_exe, rescript_legacy_exe } from "#cli/bins";
56

7+
const npmCli = path.join(
8+
path.dirname(execPath),
9+
"../lib/node_modules/npm/bin/npm-cli.js",
10+
);
11+
612
/**
713
* @typedef {{
814
* throwOnFail?: boolean,
@@ -265,7 +271,7 @@ export function setup(cwd = process.cwd()) {
265271
* @return {Promise<ExecResult>}
266272
*/
267273
npm(args = [], options = {}) {
268-
return exec("npm", args, options);
274+
return exec(execPath, [npmCli, ...args], options);
269275
},
270276
};
271277
}

0 commit comments

Comments
 (0)