我在 dep.ts 文件中提到了依赖关系,我想在另一个文件中导入引用。但我收到以下错误。请帮我解决。我正在关注下面提到的链接。
https://deno.land/manual/linking_to_external_code#it-seems-unwieldy-to-import-urls-everywhere
我的简单代码在这里。
部门
export {
log
} from "https://deno.land/std/log/mod.ts";
测试3.ts
import { log } from "./dep.ts";
export class Test3 {
public show() {
log.debug("Exploring deno ...");
}
}
const test = new Test3();
test.show();
执行命令 deno run Test3.ts 时,出现以下错误。
error: Uncaught NotFound: Cannot resolve module "file:///C:/javascriptdev1/deno-test1/deps.ts" from "file:///C:/javascriptdev1/deno-test1/Test3.ts"
at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
at async processImports ($deno$/compiler.ts:736:23)
at async processImports ($deno$/compiler.ts:753:7)
at async compile ($deno$/compiler.ts:1316:31)
at async tsCompilerOnMessage ($deno$/compiler.ts:1548:22)
at async workerMessageRecvCallback ($deno$/runtime_worker.ts:74:9)