如何解决Deno错误:未捕获PermissionDenied

问题描述 投票:1回答:2

[使用deno run app.ts命令运行应用程序并给出error: Uncaught PermissionDenied

error: Uncaught PermissionDenied: access to environment variables, run again with the --allow-env flag
    at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
    at Object.sendSync ($deno$/ops/dispatch_json.ts:72:10)
    at Object.toObject ($deno$/ops/os.ts:33:12)
    at file:///opt//deno/app.ts:5:22
deno
2个回答
2
投票
这种类型的问题,我们需要在运行应用程序时设置一个标志

1
投票
在控制台日志中,尝试访问environment variables所引起的错误,在Deno中,您必须提供/授予权限标志才能访问环境变量:
© www.soinside.com 2019 - 2024. All rights reserved.