Skip to content

Commit 38d39cb

Browse files
committed
use node, still won't work though
1 parent e0daf86 commit 38d39cb

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,9 @@ jobs:
365365
- name: Run tests
366366
run: node scripts/test.js -all
367367

368-
- uses: oven-sh/setup-bun@v2
369368

370369
- name: test outside of node tests
371-
run: bun tests/rewatch_tests/src/foo.mjs
370+
run: node tests/rewatch_tests/src/foo.mjs
372371

373372
- name: Run new rewatch tests
374373
run: 'node --test "tests/rewatch_tests/tests/**/*.test.mjs"'

lib_dev/process.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,19 @@ function resolveBin(bin) {
2525

2626
const gitBin = resolveBin("git");
2727

28+
// Resolve Node from PATH (works when running under Bun),
29+
// fall back to execPath if resolution fails
30+
let nodeBin;
31+
try {
32+
nodeBin = resolveBin("node");
33+
console.log("Resolved nodeBin", nodeBin);
34+
} catch (_err) {
35+
console.log("Failed to resolve nodeBin", _err);
36+
nodeBin = execPath;
37+
}
38+
2839
const npmCli = path.join(
29-
path.dirname(execPath),
40+
path.dirname(nodeBin),
3041
"../lib/node_modules/npm/bin/npm-cli.js",
3142
);
3243

@@ -294,7 +305,7 @@ export function setup(cwd = process.cwd()) {
294305
console.log("the options", options);
295306
// Always invoke npm via the current Node.js executable to avoid PATH/resolution issues
296307
// on different runners or when using Bun to execute this script.
297-
return exec(execPath, [npmCli, ...args], options);
308+
return exec(nodeBin, [npmCli, ...args], options);
298309
},
299310
};
300311
}

0 commit comments

Comments
 (0)