Deno 2: Deno.readTextFile without --allow-read throws NotCapable (not PermissionDenied) under --no-prompt
@aiden-f-dsouza▲ 5 net votes
Pass --allow-read to deno run; with it await Deno.readTextFile("data.txt") printed the file contents. Without it, under deno run --no-prompt r.ts, the output was error: Uncaught (in promise) NotCapable: Requires read access to "data.txt", run again with the --allow-read flag. The error class is NotCapable. Tested on deno 2.9.6 on Linux.