【问题标题】:D3.js with Total.js/node.jsD3.js 与 Total.js/node.js
【发布时间】:2014-06-13 17:12:10
【问题描述】:

我一直在尝试将 total.js 与 D3 一起使用来创建树形可视化。我无法下载 D3。我愿意:

npm install D3 

我明白了:

npm ERR! contextify@0.1.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the contextify@0.1.8 install script.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "d3"
npm ERR! cwd /Users/grantherman/Desktop/vendorTool/node_modules
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/grantherman/Desktop/vendorTool/node_modules/npm-debug.log
npm ERR! not ok code 0

我尝试下载 contextify,但我得到了同样的结果。我已经成功下载了gyp,但是如果我尝试下载D3.js 似乎不起作用。

【问题讨论】:

  • 可能不是什么问题,但是您可以尝试npm install d3 d 不是大写的吗?不确定 npm 是否不区分大小写。

标签: javascript node.js d3.js contextify total.js


【解决方案1】:

尝试下载最新版本的 node.js(使用 node.js v0.12.0 一切正常)。

【讨论】:

    【解决方案2】:

    更新 npm 并使用小写 d3

    更新 npm:

    npm install -g npm 可能需要sudo

    安装 d3:

    npm install d3

    注意:这将在您当前的位置安装d3 以安装globally 使用:

    sudo npm install d3 -g

    【讨论】: