我無(wú)法安裝任何需要編譯的模塊。它們?nèi)渴?,并出現(xiàn)以下錯(cuò)誤:MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe". ...我的環(huán)境:Windows 7 Enterprise x64版本6.1.7601節(jié)點(diǎn)x86 0.8.16npm 1.2.0節(jié)點(diǎn)gyp 0.8.2Visual Studio 2012和眾多軟件包相關(guān)環(huán)境變量:Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShel l\v1.0;C:\Program Files\TortoiseGit\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\tools;c:\tools\node沒(méi)有INCLUDE,LIB,LIBPATH等。我對(duì)該問(wèn)題進(jìn)行了簡(jiǎn)短的調(diào)查,發(fā)現(xiàn)通過(guò)以下設(shè)置,手動(dòng)克隆的git://github.com/einaros/ws.git的手動(dòng)編譯(直接調(diào)用VCBuild.exe和msbuild.exe)成功完成:SET Configuration=ReleaseSET PATH=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\vcpackagesSET PATH=%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\bin;%PATH%SET PATH=%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\Common7\IDE;%PATH%SET PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%SET PATH=%SystemRoot%\system32;%PATH%SET INCLUDE=%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\includeSET INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE%SET LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\LibSET LIB=%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\lib;%LIB%SET MSBUILD="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe"VCBuild.exe C:\Tools\node\ws\build\bufferutil.vcproj "Release|Win32" /useenvVCBuild.exe C:\Tools\node\ws\build\validation.vcproj "Release|Win32" /useenv%MSBUILD% build/binding.sln /verbosity:diagnostic /nologo /p:Configuration=Release;Platform=Win32我試圖用相同的變量調(diào)用node-gyp,但失敗了:C:\!> git clone https://github.com/einaros/ws.gitC:\!> cd wsC:\!\ws>node-gyp configure...
3 回答

幕布斯7119047
TA貢獻(xiàn)1794條經(jīng)驗(yàn) 獲得超8個(gè)贊
嘗試-將全局設(shè)置:
npm config set msvs_version 2012 --global

jeck貓
TA貢獻(xiàn)1909條經(jīng)驗(yàn) 獲得超7個(gè)贊
要在沒(méi)有安裝VS2010的情況下(僅限2012年)執(zhí)行此操作,請(qǐng)?jiān)O(shè)置msvs_version標(biāo)志:
node-gyp rebuild --msvs_version=2012
npm install <module> --msvs_version=2012
按照@Jacob的評(píng)論
npm install --msvs_version=2013 如果您有2013版
- 3 回答
- 0 關(guān)注
- 827 瀏覽
添加回答
舉報(bào)
0/150
提交
取消