npm install socket.io 提示缺少"VCBuild.exe"


如下提示:

d:\Dev\node.js\test\hello\node_modules\socket.io\node_modules\socket.io-client
ode_modules\ws>node “c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin
…\node_modules\node-gyp\bin\node-gyp.js” rebuild 在此解決方案中一次生成一個項目。若要啟用並行生成,請添加“/m”開關。 MSBUILD : error MSB3428: 未能加載 Visual C++ 組件“VCBuild.exe”。要解決此問題,

  1. 安裝 .NET Fram ework 2.0 SDK;2) 安裝 Microsoft Visual Studio 2005;或 3) 如果將該組件安裝到了 其他位置,請將其位置添加到系統 路徑中。 [d:\Dev\node.js\test\hello\node_modules\socket.io\node_modules\socket. o-c lient\node_modules\ws\build\binding.sln] MSBUILD : error MSB3428: 未能加載 Visual C++ 組件“VCBuild.exe”。要解決此問題,
  2. 安裝 .NET Fram ework 2.0 SDK;2) 安裝 Microsoft Visual Studio 2005;或 3) 如果將該組件安裝到了 其他位置,請將其位置添加到系統 路徑中。 [d:\Dev\node.js\test\hello\node_modules\socket.io\node_modules\socket. o-c lient\node_modules\ws\build\binding.sln] socket.io@0.9.13 node_modules\socket.io

之前提示python不存在,裝了ActivePython2.7.2,然后提示沒有VCBuild.exe. 又裝的windows SDK 7 等

 

其實我的電腦上已經裝了vs2008 和 vs2012了,但是還是報錯:

在此解決方案中一次生成一個項目。若要啟用並行生成,請添加“/m”開關。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(297,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.
TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [C:\Users\Jason.yang\AppData\Roaming\npm\node_modules\ws\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.targets(152,5): error MSB6006: “CL.exe”已退出,代碼為 -1073741515。 [C:\Users\Jason.yang\AppData\Roaming\npm\node_modules\ws\node_modules\bufferutil\build\bufferutil.vcxproj]
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\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074
:12)

 

經搜索網友評論,發現需要更新的強制指定,比如用vs2012

npm config set msvs_version 2012 --global


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM