NodeJS导入错误
NodeJS import error
我正在尝试使用 resemblejs 库 (http://huddle.github.io/Resemble.js/) 来比较两个图像。但是,当我创建了一个目录并将 resemblejs 添加为依赖项时,但是当我尝试 运行 以下内容时:
nodejs test.js
,我收到以下错误
var api = resemble(fileData).onComplete(function(data){
^
ReferenceError: resemble is not defined
我以前从未使用过 NodeJS,所以它可能非常简单。有什么想法吗?
您不能直接从中获取节点模块实例。您可以查看 this issue on its repo. node-resemble is an Node port of Resemble.js.
希望对你有用。
我正在尝试使用 resemblejs 库 (http://huddle.github.io/Resemble.js/) 来比较两个图像。但是,当我创建了一个目录并将 resemblejs 添加为依赖项时,但是当我尝试 运行 以下内容时:
nodejs test.js
,我收到以下错误
var api = resemble(fileData).onComplete(function(data){
^
ReferenceError: resemble is not defined
我以前从未使用过 NodeJS,所以它可能非常简单。有什么想法吗?
您不能直接从中获取节点模块实例。您可以查看 this issue on its repo. node-resemble is an Node port of Resemble.js.
希望对你有用。