我只是toastrjs
用于一些通知,我遇到了这个小问题。理想情况下,当您在 nodejs 中导入库时,您必须做出import
声明,如下所示:
import http = require("http");
但是,当我尝试使用 时toastr
,即使包含参考路径,也会出现错误。所以,像这样:
///<reference path='toastr.d.ts' />
import toastr = require("./toastr");
我收到此错误:
error TS2071: Unable to resolve external module '"./toastr.js"'.
error TS2072: Module cannot be aliased to a non-module type.
与toastr
常规节点模块有何不同http
?
更新 1
我试图做同样的事情,jQuery
但我有同样的问题,这是否意味着这不适用于设计为客户端的框架?