我正在探索deno。我在尝试启动我的(第一个 ::)deno 服务器时遇到了一个问题,输出显示“404”
服务器文件如下:
import { Drash } from "https://deno.land/x/drash@v1.0.0-rc1/mod.ts";
const server = new Drash.Http.Server({
response_output: "application/json",
resources: [],
});
server.run({
hostname: "localhost",
port: 2803,
});
返回的命令:
➜ helloDeno deno run --allow-net app.ts
Compile file:///home/totone/dev/solo/projects/helloDeno/app.ts
Download https://deno.land/std@v1.0.0-rc1/http/server.ts
Download https://deno.land/std@v1.0.0-rc1/http/http_status.ts
Download https://deno.land/std@v1.0.0-rc1/testing/asserts.ts
Download https://deno.land/std@v1.0.0-rc1/io/bufio.ts
Download https://deno.land/std@v1.0.0-rc1/io/readers.ts
Download https://deno.land/std@v1.0.0-rc1/mime/multipart.ts
Download https://deno.land/std@v1.0.0-rc1/http/cookie.ts
error: Uncaught Error: Import 'https://deno.land/std@v1.0.0-rc1/io/readers.ts' failed: 404 Not Found
at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
at async processImports ($deno$/compiler.ts:736:23)
at async processImports ($deno$/compiler.ts:753:7)
at async processImports ($deno$/compiler.ts:753:7)
at async processImports ($deno$/compiler.ts:753:7)
at async processImports ($deno$/compiler.ts:753:7)
at async compile ($deno$/compiler.ts:1316:31)
at async tsCompilerOnMessage ($deno$/compiler.ts:1548:22)
at async workerMessageRecvCallback ($deno$/runtime_worker.ts:74:9)
一开始,我认为这是对--allow-net
deno 权限的错误使用,但我尝试过一次在没有特定版本的情况下重新加载服务器以进行 drash 并且它有效。
➜ helloDeno deno run --allow-net app.ts
Compile file:///home/totone/dev/solo/projects/helloDeno/app.ts
所以问题出在@v1.0.0-rc1
包版本附近。谁能帮我理解这种行为的原因?
谢谢