2016-06-20 65 views
0

我試圖在npm上使用recommended method 1在本地安裝vega.js和vega編輯器,但是我的Mac從未完成運行npm install如何在本地運行vega示例安裝`vega.js`和`vega editor`?

我也嘗試了第三種方法:npm install vega,這次我設法將vega.js安裝爲節點模塊,請參閱下圖。但是,我不知道如何使用這個節點項目和vega模塊運行vega示例。 enter image description here

當我試圖安裝織女編輯我跑npm run vendor,我得到了以下錯誤:

They are for You: /Users/Natsume/Documents/D3_dc/3. node_npm_vega 
->npm run vendor 
npm ERR! Darwin 15.5.0 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "vendor" 
npm ERR! node v4.4.5 
npm ERR! npm v2.15.5 
npm ERR! path /Users/Natsume/Documents/D3_dc/3. node_npm_vega/package.json 
npm ERR! code ENOENT 
npm ERR! errno -2 
npm ERR! syscall open 

npm ERR! enoent ENOENT: no such file or directory, open '/Users/Natsume/Documents/D3_dc/3. node_npm_vega/package.json' 
npm ERR! enoent This is most likely not a problem with npm itself 
npm ERR! enoent and is related to npm not being able to find a file. 
npm ERR! enoent 

npm ERR! Please include the following file with any support request: 
npm ERR!  /Users/Natsume/Documents/D3_dc/3. node_npm_vega/npm-debug.log 
They are for You: /Users/Natsume/Documents/D3_dc/3. node_npm_vega 

這似乎表明,應該有一個package.json,但我應該從哪裏得到的呢?我應該繼續尋找如何使用npm安裝vega和vega編輯器的答案嗎?

如果可能,任何人都可以告訴我如何在本地運行vega編輯器,而不使用npm install?謝謝!

+0

爲什麼最好使用node和npm安裝甚至運行vega項目? – Daniel

回答

0

我剛剛制定了一種方法來在本地運行一些vega示例,而不使用npm。

原來它是通過reading this page實現的。

  1. 應對和基本使用粘貼代碼,以使自己的index.html
  2. 複製和粘貼維加實例文件夾到你自己的工作目錄
  3. 複製和粘貼維加數據集中到工作目錄
  4. 然後選擇example.json文件並填入你的index.html並運行

但是,這個解決方案仍然不能讓我在本地使用vega編輯器。 Vega編輯器的調試器看起來很棒。