为了账号安全,请及时绑定邮箱和手机立即绑定

代码好多坑额,node-gyp要vs::::

MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe". If the component is not install

ndows SDK for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual Studio 2008.  [E:\movi

les\mongodb\node_modules\bson\build\binding.sln]


正在回答

6 回答

用npm install -g appium进行安装,出现如下错误,已经安装了.net framework4.0还是不行,请高手指点,万分感激。

http://img1.sycdn.imooc.com//595ce4fb00018ba206720628.jpg

0 回复 有任何疑惑可以回复我~

记录一下,之前的NPM版本是1.3.14,安装最新版的mongodb是老是报错

MSBUILD : error MSB6006: “VCBuild.exe”已退出,代码为 -1。 [F:\SingleWebPage\MongoDB\webapp\node_modules\bson\node_modules\bson-ext\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 (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "D:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=F:\\SingleWebPage\\MongoDB\\webapp\\node_modules\\bson\\node_modules\\bson-ext
\\build\\Release\\bson.node" "--module_name=bson" "--module_path=F:\\SingleWebPage\\MongoDB\\webapp\\node_modules\\bson\\node_modules\\bson-ext\\build\\Release"
gyp ERR! cwd F:\SingleWebPage\MongoDB\webapp\node_modules\bson\node_modules\bson-ext
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.11.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=F:\SingleWebPage\MongoDB\webapp\node_modules\bson\node_modules\bson-ext\build\Release\bson.node --module_name=bson --m
odule_path=F:\SingleWebPage\MongoDB\webapp\node_modules\bson\node_modules\bson-ext\build\Release' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (F:\SingleWebPage\MongoDB\webapp\node_modules\bson\node_modules\bson-ext\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:735:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:802:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "node" "F:\\SingleWebPage\\MongoDB\\webapp\\node_modules\\bson\\node_modules\\bson-ext\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp.js" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd F:\SingleWebPage\MongoDB\webapp\node_modules\bson\node_modules\bson-ext
node-pre-gyp ERR! node -v v0.10.22
node-pre-gyp ERR! node-pre-gyp -v v0.6.4
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=F:\SingleWebPage\MongoDB\webapp\node_modules\bson\node_modules\bson-ext\build\Release\bson.node --module_name=bson --module_path=F:\SingleWebPage\Mon
goDB\webapp\node_modules\bson\node_modules\bson-ext\build\Release' (1)

我的内心几乎是奔溃的。用二楼的方法还是不行,

最后是重新安装了nodejs,这是的版本是2.10.1,再安装mongodb时没有错误了

0 回复 有任何疑惑可以回复我~

2楼答案亲测可用


0 回复 有任何疑惑可以回复我~

原因

npm在1.3.15版本以前node-gyp 在编译时会调用VCBuild.exe,在vs2012下是找不到的VCBuild.exe, vs2012及以后版本是msbuild.exe作为编译器。

解决:

将npm 的 msvs的编译器设置为vs2012

cmd执行:

npm config set msvs_version 2012 --global 


1 回复 有任何疑惑可以回复我~

还好我这里没问题,我有VS2013,也安装了ruby和python,不然编译不过。

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
node建站攻略(二期)——网站升级
  • 参与学习       51967    人
  • 解答问题       408    个

帮助你深入前后端开发留下的迷惑,为进一步自学打下基础

进入课程
意见反馈 帮助中心 APP下载
官方微信