【问题标题】:Deno Watcher | Uncaught AddrInUse: Only one usage of each socket addressDeno 观察者 | Uncaught AddrInUse:每个套接字地址只有一次使用
【发布时间】:2022-11-26 20:53:57
【问题描述】:

当我在保存文件并重新启动 deno watcher 后使用 Deno watcher 时

提出这个问题并在终端中显示:

Watcher File change detected! Restarting!
    error: Uncaught AddrInUse: Only one usage of each socket address (protocol/network address/port) is normally permitted. (os error 10048)
Watcher Process finished. Restarting on file change...

保存 app.ts 后再次在终端中显示以下行:

Watcher File change detected! Restarting!
error: Uncaught AddrInUse: Only one usage of each socket address (protocol/network address/port) is normally permitted. (os error 10048)
    core.runMicrotasks();
         ^
    at Object.runMicrotasks (deno:core/01_core.js:377:30)
    at processTicksAndRejections (https://deno.land/std@0.164.0/node/_next_tick.ts:62:10)
Watcher Process finished. Restarting on file change...

我的应用程序:

import express, { Express, Request, Response } from "npm:express@4.18";
import { v4 as uuidv4 } from 'npm:uuid@9.0.0';
const app: Express = express();

app.use("/", (_req: Request, res: Response) => {
    res.send(`uuid: ${uuidv4()}.`);
})

app.listen(8000, () => {
    console.log("App Running: http://localhost:8000");
});

使用的命令: deno run --allow-all --watch app.ts

德诺版本:

deno 1.28.0 (release, x86_64-pc-windows-msvc) | v8 10.9.194.1 | typescript 4.8.3

操作系统:Windows 11

【问题讨论】:

  • 看起来它可能是 deno 中的一个错误。如果你愿意,你可以在他们的 github 存储库中创建一个问题:github.com/denoland/deno/issues
  • 在本地测试并重现了错误,不确定使用原生 deno http 服务器而不是 express 是否会观察到相同的行为
  • 我继续制作并发布:github.com/denoland/deno/issues/16699

标签: javascript typescript deno


【解决方案1】:

这是 Deno 中的一个错误(参见 https://github.com/denoland/deno/issues/16699#issuecomment-1322854380),并在 Deno v1.28.2 中进行了修补。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-01-16
    • 1970-01-01
    • 2018-02-13
    • 1970-01-01
    • 1970-01-01
    • 2014-05-29
    • 1970-01-01
    相关资源
    最近更新 更多