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



得到一些令人费解的上下文错误(但其他安装似乎很好。

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:Usersdineshm3node_modulesd3node_modulesjsdomnode_modulescontextifybuildbinding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:WindowsMicrosoft.NETFrameworkv4.0.30319msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:Program Files (x86)nodejsnode_modulesnpmnode_modulesnode-gyplibbuild.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:Usersdineshm3node_modulesd3node_modulesjsdomnode_modulescontextify
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

你可能已经离开了,但对于未来的谷歌员工:

升级到 D3.js v3.5.4+

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

相关:D3.js提交和 D3.js 问题。

最新更新