Deno Uncaught AddrInUse:每个套接字地址(协议/网络地址/端口)通常仅允许使用一种. (操作系统错误10048) [英] Deno Uncaught AddrInUse: Only one usage of each socket address (protocol/network address/port) is normally permitted. (os error 10048)

查看:154
本文介绍了Deno Uncaught AddrInUse:每个套接字地址(协议/网络地址/端口)通常仅允许使用一种. (操作系统错误10048)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行我的Deno文件时,我得到了os error 10048,如何解决该错误?谢谢

When I try to run my deno file I got os error 10048, How can I solve this error? Thank you

 import { Application } from 'https://deno.land/x/oak/mod.ts'

const app = new Application();
const port = 3000;

app.use((ctx) => {
    ctx.response.body = "Hello World"
})

app.listen({ port })
console.log(`localhost:${port}`)

我尝试运行我的Deno文件,但出现此错误

I tried to Run my Deno file but I got this error

D:\Deno Documentation\deno3>deno run --allow-net ./server.js
localhost:3000
error: Uncaught AddrInUse: Only one usage of each socket address (protocol/network address/port) is normally permitted. (os error 10048)
    at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
    at Object.sendSync ($deno$/ops/dispatch_json.ts:72:10)
    at Object.listen ($deno$/ops/net.ts:51:10)
    at listen ($deno$/net.ts:152:22)
    at Application.serve (https://deno.land/std@0.56.0/http/server.ts:252:20)
    at Application.listen (https://deno.land/x/oak/application.ts:295:20)
    at file:///D:/Deno%20Documentation/deno3/server.js:10:5

推荐答案

您有另一个程序正在监听端口3000,将端口更改为未使用的端口,或者杀死正在3000上运行的程序.

You have another program listening on port 3000, change the port to an unused one, or kill the program running on 3000.

这篇关于Deno Uncaught AddrInUse:每个套接字地址(协议/网络地址/端口)通常仅允许使用一种. (操作系统错误10048)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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