Deno-加载依赖包出错

8次阅读

共计 479 个字符,预计需要花费 2 分钟才能阅读完成。

视频讲解

https://www.bilibili.com/video/BV1qK4y1x7VG/

在开发过程中,经常遇到 DNS 解析域名错误的问题。导致 js 依赖包没法下载

我们一起来完成以下步骤:

  1. 先来发现问题
  2. 域名是否能访问?
  3. 解析域名 (https://www.ipaddress.com/) 的 IP。在没有使用翻墙 情况下是否能 ping 通
  4. 修改 Hosts 文件(C:\Windows\System32\drivers\etc)
  5. 再重新 run 一下应用

main.ts


import {Application, Router} from "https://deno.land/x/oak/mod.ts";

const router = new Router();
const app = new Application();

router.get("/",(ctx) =>{ctx.response.body="Hello World";})

app.use(router.routes());
app.use(router.allowedMethods());

await app.listen({port:8000});

正文完
 0