首页 > 解决方案 > [错误]:“typeof Deno”类型上不存在属性“openPlugin”

问题描述

error: TS2339 [ERROR]: Property 'openPlugin' does not exist on type 'typeof Deno'.
  return Deno.openPlugin(localPath);
              ~~~~~~~~~~
    at https://deno.land/x/plugin_prepare@v0.6.0/mod.ts:64:15

服务器项目时出现这样的错误帮助我任何人对此有任何想法。谢谢你

标签: deno

解决方案


你必须使用--unstable标志运行 Deno。

您可以检查openPlugin当前是不稳定的 API。


有关稳定性的更多信息:

从 Deno 1.0.0 开始,Deno 命名空间 API 是稳定的。这意味着我们将努力使在 1.0.0 下工作的代码在未来的版本中继续工作。

但是,并非 Deno 的所有功能都已准备好投入生产。尚未准备好的功能,因为它们仍处于草稿阶段,被锁定在--unstable命令行标志后面。


推荐阅读