Can not load some modules in deno

Viewed 1015

I just started learning deno and I have already faced "bug like" problems.

When I import oak module to my deno app, it compiles successfully; but when I load mongo or bcrypt, it crashes and shows me this error.

error: The system cannot find the path specified. (os error 3)

export { Application, Router } from "https://deno.land/x/oak/mod.ts";
export { init, mongoClient } from "https://deno.land/x/mongo/mod.ts";

Here first line is executed correctly, but the second line throws an error.

1 Answers

First of all, use this line

export { init, MongoClient } from "https://deno.land/x/mongo/mod.ts";

instead of

export { init, mongoClient } from "https://deno.land/x/mongo/mod.ts";

Then reload the cache by running this command:

deno cache --reload --unstable app.js

Then run by using this command:

deno run -A --unstable app.js
Related