Deno-Uncaught PermissionDenied:网络访问 [英] Deno - Uncaught PermissionDenied: network access

查看:162
本文介绍了Deno-Uncaught PermissionDenied:网络访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行 Deno 例如,我遇到错误:

I'm trying out Deno and while running an example, I ran into error:

$ deno run https://deno.land/std/examples/curl.ts https://example.com
Download https://deno.land/std/examples/curl.ts
Warning Implicitly using master branch https://deno.land/std/examples/curl.ts
Compile https://deno.land/std/examples/curl.ts
error: Uncaught PermissionDenied: network access to "https://example.com/", run again with the --allow-net flag
    at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
    at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
    at async fetch ($deno$/web/fetch.ts:591:27)
    at async https://deno.land/std/examples/curl.ts:3:13

我尝试做过

$ deno run https://deno.land/std/examples/curl.ts https://example.com --allow-net

,但仍然会收到相同的错误。我在做什么错了?

but still get the same error. What am I doing wrongly?

推荐答案

-allow-net 标志必须 deno运行之后之后且在文件名之前,而不是在末尾附加。

The --allow-net flag has to be after deno run and before the file name, not appended at the end.

deno run --allow-net https://deno.land/std/examples/curl.ts https://example.com

这篇关于Deno-Uncaught PermissionDenied:网络访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆