【问题标题】:How to install `vega.js` and `vega editor` for running vega examples locally?如何安装 `vega.js` 和 `vega editor` 以在本地运行 vega 示例?
【发布时间】:2016-06-20 09:01:46
【问题描述】:

我尝试使用带有 npm 的 recommended method 1 在本地安装 vega.js 和 vega 编辑器,但我的 Mac 从未完成运行 npm install

我也尝试了第三种方法:npm install vega,这次我设法将 vega.js 安装为节点模块,见下图。但是,我不知道如何使用这个节点项目和 vega 模块运行 vega 示例。

当我在运行npm run vendor 时尝试安装 vega 编辑器时,出现以下错误:

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 编辑器的答案?

如果可能,谁能告诉我如何在不使用npm install 的情况下在本地使用 vega 编辑器运行 vega 示例?谢谢!

【问题讨论】:

  • 为什么首选使用 node 和 npm 安装甚至运行 vega 项目?

标签: vega


【解决方案1】:

我刚刚找到了一种不使用 npm 在本地运行一些 vega 示例的方法。

原来是reading this page实现的。

  1. 基本使用中复制并粘贴代码来制作您自己的 index.html
  2. 将 vega 示例文件夹复制并粘贴到您自己的工作目录中
  3. 将 vega 数据集复制并粘贴到您的工作目录中
  4. 然后选择 example.json 文件并填写您的 index.html 并运行

但是,这个解决方案仍然不能让我在本地使用 vega 编辑器。 Vega 编辑器的调试器看起来很棒。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-05-07
    • 1970-01-01
    • 2020-03-19
    • 2022-08-10
    • 1970-01-01
    • 1970-01-01
    • 2020-04-22
    • 1970-01-01
    相关资源
    最近更新 更多