无法使用 Deno-Db 连接到 PostgressSql - 找不到模块“events.ts”

问题描述 投票:0回答:0

我正在尝试使用 Deno-db 连接到 Postgres sql,我从 官方文档 中获取了下面的代码并对其进行编辑以连接到我的本地服务器。

import {
    Database,
    PostgresConnector,
} from "https://deno.land/x/[email protected]/mod.ts";

// SQLite3Connector, MySQLConnector, PostgresConnector...
const connector = new PostgresConnector({
    uri: "localhost",
    port: 5433,
    password: "",
    database: "mora",
    host: "localhost",
    username: "postgres",
});

// const db = new Database(connector);

// If you need debug logs, set `debug` to `true`
const db = new Database({ connector, debug: true });

错误:

error: Module not found "https://deno.land/std/node/events.ts". at https://raw.githubusercontent.com/Zhomart/dex/930253915093e1e08d48ec0409b4aee800d8bd0c/lib-dyn/deps.ts:7:24

我尝试将导入版本从最新更改为重定向版本(@1.4.0)

import {
    Database,
    PostgresConnector,
} from "https://deno.land/x/[email protected]/mod.ts";

仍然面临同样的问题。

我的 Deno 版本: deno 1.35.3(发布,x86_64-apple-darwin) v8 11.6.189.12 打字稿 5.1.6 节点版本:v12 至 v19。

我还尝试使用 VPN 更改我的 IP 地址。

另一个问题:

Deno-Db 是否设计用于连接多个数据库?我是不是错过了什么?

typescript postgresql deno connector denodb
© www.soinside.com 2019 - 2024. All rights reserved.