Deno Uncaught AddrInUse: Only one usage of each socket address (protocol/network address/port) is normally permitted. (os error 10048)

拜拜、爱过 提交于 2020-06-29 04:13:11

问题


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}`)

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

回答1:


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



来源:https://stackoverflow.com/questions/62189026/deno-uncaught-addrinuse-only-one-usage-of-each-socket-address-protocol-network

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!