使用npm安装d3会导致上下文错误

时间:2014-12-10 20:50:08

标签: d3.js npm

获得一些神秘的背景错误(但其他安装似乎没问题。)

npm install d3

    MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install
Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.  
[C:\Users\dinesh\m3\node_modules\d3\node_modules\jsdom\node_modules\contextify\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\dinesh\m3\node_modules\d3\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

npm ERR! contextify@0.1.9 install: `node-gyp rebuild`
npm ERR! Exit status 1

npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28

1 个答案:

答案 0 :(得分:11)

你可能已经开始了,但对于未来的googlers:

升级到D3.js v3.5.4 +

jsdomd3的依赖关系,jsdom需要contextify,它使用本机模块(node-gyp)。原生模块很难在某些平台上构建,因此从{v3.5.4}开始,d3使jsdom成为开发依赖项(默认情况下未安装)。

相关:D3.js commitD3.js issue