【问题标题】:FabricJS - What is Building?FabricJS - 什么是建筑?
【发布时间】:2016-04-22 22:10:48
【问题描述】:

我已经安装了 NodeJS,在顶部添加了 Express,现在我无法让 FabricJS 工作。

我是否必须按照“构建”下 https://github.com/kangax/fabric.js/ 中的步骤才能使 FabricJS 工作?

我尝试在我的应用程序的根目录中运行 $ node build.js,这给了我:

$ node build.js
module.js:327
    throw err;
    ^

Error: Cannot find module 'D:\Drive\Personal\Sandbox\express-angular-app\build.j
s'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:134:18)
    at node.js:962:3

还有在给我的结构模块文件夹中:

$ node build.js
D:\Drive\Personal\Sandbox\express-angular-app\node_modules\fabric\build.js:93
      if (err) throw err;
               ^

Error: ENOENT: no such file or directory, open 'D:\Drive\Personal\Sandbox\expres
s-angular-app\node_modules\fabric\HEADER.js'
    at Error (native)

我使用 Jade,我的 index.jadefabric.js 中有以下内容:

index.jade and fabric.js

【问题讨论】:

    标签: fabricjs


    【解决方案1】:

    问题是我混淆了后端和前端。我期待代码通过 npm 安装结构模块从后端工作。

    相反,我只是在头部添加了 CDN 链接,它在客户端中运行。

    【讨论】:

    • 是的,fabricjs 主要是一个前端库。你可以让它在 nodejs 上工作,但只是为了一些服务器端渲染,而不是为了用户交互
    猜你喜欢
    • 2011-04-26
    • 2010-12-09
    • 2010-10-03
    • 1970-01-01
    • 2014-06-07
    • 2020-06-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多