File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff 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"'
Original file line number Diff line number Diff line change @@ -25,8 +25,19 @@ function resolveBin(bin) {
2525
2626const 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+
2839const 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}
You can’t perform that action at this time.
0 commit comments