简体   繁体   English

Deno“未找到:没有这样的文件或目录(操作系统错误 2)”

[英]Deno "NotFound: No such file or directory (os error 2)"

I'm working on a Deno side project that runs a server using Oak.我正在开发一个使用 Oak 运行服务器的 Deno 端项目。 I'm trying to run the server with HTTPS and I'm playing around with WebSockets and some basic authentication.我正在尝试使用 HTTPS 运行服务器,并且正在使用 WebSockets 和一些基本身份验证。 The same code runs fine on a different computer but not on my laptop.相同的代码在另一台计算机上运行良好,但在我的笔记本电脑上却不行。

I'm using the following run command and flags like this or it won't work on the other machine:我正在使用以下run命令和这样的标志,否则它将无法在另一台机器上运行:

deno run --import_map=my-import-map.json --allow-read --allow-write --allow-net --unstable myserver.ts

I know that the server starts and fires the "listen" event because I get my console log of Listening on: https://localhost:443 but I can't figure out what the problem is with my code that is causing Deno to produce the following error message.我知道服务器启动并触发“监听”事件,因为我得到了Listening on: https://localhost:443但我无法弄清楚导致 Deno 产生的代码的问题是什么以下错误消息。

NotFound: No such file or directory (os error 2)
    at deno:core/core.js:86:46
    at unwrapOpResult (deno:core/core.js:106:13)
    at Object.opSync (deno:core/core.js:120:12)
    at opListenTls (deno:runtime/js/40_tls.js:19:17)
    at Object.listenTls (deno:runtime/js/40_tls.js:56:17)
    at Object.start (https://deno.land/x/oak@v7.4.1/http_server_native.ts:160:16)
    at Object.<anonymous> (deno:extensions/fetch/11_streams.js:94:22)
    at startAlgorithm (deno:extensions/fetch/11_streams.js:1851:36)
    at setUpReadableStreamDefaultController (deno:extensions/fetch/11_streams.js:1815:25)
    at setUpReadableStreamDefaultControllerFromUnderlyingSource (deno:extensions/fetch/11_streams.js:1861:5)

I've tried upgrading Deno and reloading the cache.我已经尝试升级 Deno 并重新加载缓存。 I'm not even sure where to access the files that are in the stack trace to find out more.我什至不确定从哪里访问堆栈跟踪中的文件以了解更多信息。

The biggest issue I have with this problem is that the same unaltered code works on a different computer.我遇到的最大问题是相同的未更改代码在不同的计算机上工作。

If I find out what is going on I'll post my solution here.如果我发现发生了什么,我会在这里发布我的解决方案。

Thank you to anyone who can help!感谢任何可以提供帮助的人!

So it turns out that I needed to regenerate my local SSL certs.所以事实证明我需要重新生成我的本地 SSL 证书。

I also had to change the port that I was using on this machine afterwards because I've consistently had the problem of the default ports 80 and 443 being unavailable to use on this particular machine.之后我还不得不更改我在这台机器上使用的端口,因为我一直遇到默认端口 80 和 443 无法在这台特定机器上使用的问题。

I have an all new problem though.我有一个全新的问题。 I have a ton of TLS alerts now for using my self signed cert for testing that I can't seem to get rid of in my console.我现在有大量 TLS 警报用于使用我的自签名证书进行测试,我似乎无法在控制台中摆脱这些警报。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM