-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Labels
Description
The follow program fails under node and bun:
import fs from 'node:fs';
fs.writeFileSync('foo.txt', 'hello')
fs.rmdirSync('foo.txt')
For exmaple:
$ node test.mjs
node:fs:1215
binding.rmdir(pathModule.toNamespacedPath(path));
^
Error: ENOTDIR: not a directory, rmdir 'foo.txt'
at Object.rmdirSync (node:fs:1215:11)
at file:///usr/local/google/home/sbc/dev/wasm/emscripten/test.mjs:4:4
at ModuleJob.run (node:internal/modules/esm/module_job:263:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:540:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
errno: -20,
code: 'ENOTDIR',
syscall: 'rmdir',
path: 'foo.txt'
}
Node.js v20.19.2
But it succeeds under deno:
$ ~/.deno/bin/deno -A test.mjs
$ stat foo.txt
stat: cannot statx 'foo.txt': No such file or directory
Reactions are currently unavailable