summaryrefslogtreecommitdiff
path: root/std/node
diff options
context:
space:
mode:
Diffstat (limited to 'std/node')
-rw-r--r--std/node/module.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/std/node/module.ts b/std/node/module.ts
index 3d51bf641..7ed43349f 100644
--- a/std/node/module.ts
+++ b/std/node/module.ts
@@ -54,6 +54,9 @@ function stat(filename: string): StatResult {
if (statCache !== null) statCache.set(filename, result);
return result;
} catch (e) {
+ if (e.kind === Deno.ErrorKind.PermissionDenied) {
+ throw new Error("CJS loader requires --allow-read.");
+ }
return -1;
}
}