尝试在我的:上运行简单的Deno Js OAK中间件服务器时出错:
Ubuntu 18.04,
Deno 1.0.4,
v8 8.4.300,
typescript 3.9.2 通过运行deno run index.js或运行deno run -A index.js
$ deno run index.js
Compile file:///home/some/tst/index.js
error: Uncaught AssertionError: Unexpected skip of the emit.
at Object.assert ($deno$/util.ts:33:11)
at compile ($deno$/compiler.ts:1170:7)
at tsCompilerOnMessage ($deno$/compiler.ts:1338:22)
at workerMessageRecvCallback ($deno$/runtime_worker.ts:72:33)
at file:///home/some/dcode/tst/__anonymous__:1:1这是我的index.js文件代码:
import { Application } from "https://deno.land/x/oak/mod.ts";
const app = new Application();
app.use((ctx) => {
ctx.response.body = "Hello World!";
});
await app.listen({ port: 8000 });发布于 2020-06-05 11:42:19
将文件类型从.js更改为.ts.
我在Deno中介绍了入门部分中的“复杂程序”,直到我将文件类型从javascript更改为类型之前,我无法运行该程序。我希望能帮到你!
发布于 2020-06-04 11:08:11
这是v1.0.3或v1.0.4中介绍的一个问题:https://github.com/denoland/deno/issues/6082,它仍在1.0.5中发生
在修复之前,解决方案是将Deno降级为1.0.0,并使用Oak 4.0.0,这是该Deno版本的适当Oak版本。
import { Application } from 'https://deno.land/x/oak@v4.0.0/mod.ts'若要降低Deno的级别,可以执行下面是
curl -fsSL https://deno.land/x/install/install.sh | sh -s v1.0.0或者如果您使用的是Windows:
$v="1.0.0"; iwr https://deno.land/x/install/install.ps1 -useb | iexhttps://stackoverflow.com/questions/62193086
复制相似问题