Clive Ward-Cron
Clive Ward-Cron

Reputation: 51

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

I'm working on a Deno side project that runs a server using Oak. I'm trying to run the server with HTTPS and I'm playing around with WebSockets and some basic authentication. 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:

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.

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/[email protected]/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. 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!

Upvotes: 2

Views: 2867

Answers (1)

Clive Ward-Cron
Clive Ward-Cron

Reputation: 51

So it turns out that I needed to regenerate my local SSL certs.

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.

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.

Upvotes: 1

Related Questions