DEV Community

Discussion on: Write your first API with Deno

Collapse
 
micksp profile image
Michael Sperber

After the first code snippet, I get an error:

└─ $ ▶ deno run --allow-read --allow-net server.ts
error: Uncaught NotFound: No such file or directory (os error 2)
    at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
    at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
    at async Object.open ($deno$/files.ts:37:15)
    at async Object.readFile ($deno$/read_file.ts:13:16)
    at async load (https://deno.land/x/denv/mod.ts:19:15)
    at async https://deno.land/x/denv/mod.ts:29:1

Any thoughts on whats going wrong?

deno 1.0.1
v8 8.4.300
typescript 3.9.2
Collapse
 
saswatamcode profile image
Saswata Mukherjee

Looks like your denv module is missing. Maybe you weren't connected to the internet when you ran the program and Deno couldn't load the module. You need an active net connection to get the denv and abc modules.

Collapse
 
micksp profile image
Michael Sperber

Thanks Saswata. I removed the cache dir (~/.cache/deno) and executed the deno run command again. Got the same error alas. This time I was on a network cable (previously on wifi) and deno didn't report any errors during all download. I'm giving up I'm afraid. The message is not very clear and Google is not my friend in this instance.

Collapse
 
nikolabosnjak6 profile image
Nikola Bosnjak • Edited

you are missing .env file

Collapse
 
micksp profile image
Michael Sperber

That was the solution! It seems we need an empty .env in the project dir. Thanks Nikola!

Thread Thread
 
nikolabosnjak6 profile image
Nikola Bosnjak

NP. I have made same mistake :D