Skip to content

Commit 8e6ceed

Browse files
committed
chore: In Node.js 22 and Node.js 24 __dirname does not exist
For some reason, Node.js 22 and Node.js 24 are more strict on whether __dirname exists. Because import.meta.dirname always exist, and must be equal, replace at the beginning of the script.
1 parent 259f75e commit 8e6ceed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/cli-repl/src/run.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { expect } from 'chai';
55
import { once } from 'events';
66
const execFile = promisify(childProcess.execFile);
77

8+
const __dirname = import.meta.dirname;
9+
810
describe('CLI entry point', function () {
911
const pathToRun = [
1012
'-r',

0 commit comments

Comments
 (0)