2016-04-22 33 views
0

我已經安裝了NodeJS,在上面添加了Express,現在我不能讓FabricJS工作。FabricJS - 什麼是建築?

我是否必須按照「Building」下的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) 

我用玉和我有以下是我的index.jadefabric.js

index.jade and fabric.js

回答

2

問題是我混淆了後端和前端。我期望通過npm安裝結構模塊,從後端開始工作。

相反,我只是在頭部添加了CDN鏈接,它在客戶端運行。

+0

yes fabricjs主要是一個前端庫。您可以使它在nodejs上工作,但僅用於某些服務器端渲染,而不是用於用戶交互 – AndreaBogazzi