node-gyp icon indicating copy to clipboard operation
node-gyp copied to clipboard

MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".

Open Hao-Wu opened this issue 13 years ago • 85 comments

This occurs when I am trying to build jquery mobile. However, I can still build it successfully with the error. Please see logs for reference.

E:\GitHub\jquery-mobile>npm install
npm http GET https://registry.npmjs.org/jquery
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/grunt-qunit-junit
npm http 304 https://registry.npmjs.org/jquery
npm http 304 https://registry.npmjs.org/grunt-qunit-junit
npm http 304 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/location/0.0.1
npm http GET https://registry.npmjs.org/htmlparser/1.7.6
npm http GET https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/xmlhttprequest
npm http GET https://registry.npmjs.org/navigator
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/htmlparser/1.7.6
npm http 304 https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/location/0.0.1
npm http 304 https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/navigator
npm http 304 https://registry.npmjs.org/xmlhttprequest
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/cssstyle
npm http 304 https://registry.npmjs.org/bindings

> [email protected] install E:\GitHub\jquery-mobile\node_modules\jquery\node_modu
les\contextify
> node-gyp rebuild


E:\GitHub\jquery-mobile\node_modules\jquery\node_modules\contextify>node "D:\nod
ejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.
js" rebuild
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/cssstyle
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/cookie-jar
npm http GET https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/hawk
npm http 304 https://registry.npmjs.org/node-uuid
npm http 304 https://registry.npmjs.org/cookie-jar
npm http 304 https://registry.npmjs.org/aws-sign
npm http 304 https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/forever-agent
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/json-stringify-safe
npm http 304 https://registry.npmjs.org/oauth-sign
npm http 304 https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/asn1/0.1.11
npm http GET https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/assert-plus/0.1.2
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/sntp
npm http GET https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/cryptiles
npm http 304 https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
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 Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere.  [E:\GitHub\jquery-mobile\node_modules\jquery\node_modu
les\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 (D:\nodejs\node_modules\npm\node_modul
es\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" "rebuild"
gyp ERR! cwd E:\GitHub\jquery-mobile\node_modules\jquery\node_modules\contextify

gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! Error: ENOENT, open 'E:\GitHub\jquery-mobile\node_modules\jquery\node_m
odules\jsdom\node_modules\cssstyle\lib\properties\borderLeftStyle.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "D:\\nodejs\\\\node.exe" "D:\\nodejs\\node_modules\\npm\\bin\\n
pm-cli.js" "install"
npm ERR! cwd E:\GitHub\jquery-mobile
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path E:\GitHub\jquery-mobile\node_modules\jquery\node_modules\jsdom\nod
e_modules\cssstyle\lib\properties\borderLeftStyle.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! weird error 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     E:\GitHub\jquery-mobile\npm-debug.log
npm ERR! not ok code 0

Hao-Wu avatar Aug 13 '13 08:08 Hao-Wu

Were yo able to close this?

chinmayrane avatar Dec 03 '13 08:12 chinmayrane

Do you have Visual Studio with a C++ compiler installed?

MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".

basically says "you don't have a c++ compiler installed'. You can install Visual Studio with just Visual Basic or C# so you can see this error even when VS is installed.

I would suggest installing Visual Studio Express 2013 for Windows Desktop. This comes with the C++ compiler by default.

JayBeavers avatar Dec 06 '13 02:12 JayBeavers

I get a similar error when trying "npm install msgpack":

PS C:\projects\klarna-test> npm install msgpack
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm http GET https://registry.npmjs.org/msgpack
npm http 200 https://registry.npmjs.org/msgpack

> [email protected] install C:\projects\klarna-test\node_modules\msgpack
> node-gyp rebuild


C:\projects\klarna-test\node_modules\msgpack>node "C:\local\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "/m" hinzufügen.
MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe". If the component is not installe
d, either 1) install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5, or 2) install Mic
rosoft Visual Studio 2008.  [C:\projects\klarna-test\node_modules\msgpack\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\local\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" "C:\\local\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\projects\klarna-test\node_modules\msgpack
gyp ERR! node -v v0.10.20
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

Windows 7 / 64 bit, I do have installed "Microsoft Windows SDK for Windows Server 2008" as well as Visual Studio 2013.

k-j-kleist avatar Dec 20 '13 09:12 k-j-kleist

Had to install Microsoft Visual Studio Express. Essentially now I have to install Python and Visual Studio for running Node modules just because am a Windows user. Where is Ryan?

chinmayrane avatar Dec 20 '13 09:12 chinmayrane

Although I installed "Microsoft Windows SDK for Windows Server 2008", node-gyp is using "C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe" which is part of Visual Studio 2013.

http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx

Sigh...

k-j-kleist avatar Dec 20 '13 10:12 k-j-kleist

Giving up on this as for now! According to #343 support for Visual Studio 2013 is in work, so I'll be patient rather than waste time trying to find out why node-gyp pukes on me.

k-j-kleist avatar Dec 20 '13 10:12 k-j-kleist

Are you getting the same error again, I installed Visual Studio 2010 Express Edition and viola, the errors went for me! Is it the Python error or the MSBuild.exe Error?

chinmayrane avatar Dec 20 '13 11:12 chinmayrane

Microsoft recommends installing VS 2010 before VS 2013. No way that I'll uninstall 2013, install 2010, then reinstall 2013...

Will do development on Linux for this time.

k-j-kleist avatar Dec 20 '13 11:12 k-j-kleist

Hahah. Windows is as Important as PHP. :P

chinmayrane avatar Dec 20 '13 12:12 chinmayrane

I met the same problem, and I already have VS 2013 Express installed. No way I'll reinstall 2013. I hate windows.

knightuniverse avatar Mar 27 '15 01:03 knightuniverse

+1 to hating windows, i can't get this to work even after installed visual studio 2015 express.

joshbedo avatar Jul 01 '15 19:07 joshbedo

I closed this issue because I left Windows and switched to Mac OS X as my development env.

Since the issue still exists per above comments, re-open this issue.

Hao-Wu avatar Jul 02 '15 05:07 Hao-Wu

@Hao-Wu Yeah i typically use my Mac but the hard drive started failing so i switched over to my windows machine. So i figured out the problem, I installed Visual Studio for the Web which doesn't include a C++ compiler. I uninstalled that version and installed the community version.. now everything seems to be working fine.

joshbedo avatar Jul 02 '15 07:07 joshbedo

I also had this problem because I had VS 2013 Express for Web installed, which doesn't include the C++ compilers. However, the Windows 7 64-bit SDK does include the C++ compiler (but you have to pick it during the installation process).

gregjhogan avatar Jul 17 '15 14:07 gregjhogan

I have this issue. Can't I just use MinGW compiler or sometihing?

yacineMTB avatar Jul 17 '15 18:07 yacineMTB

Installing Visual Studio Community Edition (2015) with Visual C++ selected in the install solved the issue for me on Windows 8.1.

JeffreyBPetersen avatar Oct 12 '15 20:10 JeffreyBPetersen

I can confirm @JeffreyBPetersen 's fix, combined with setting "npm config set msvs_version 2015 --global" in the command line solved the issue for me. Though I tried every other way possible without having to install 8 gigs worth of a program I'll never use first....seems excessive.

brokenalarms avatar Nov 03 '15 18:11 brokenalarms

This occurs when I am going to install socket.io . How to solve it?

C:\try1>npm install --save [email protected]

[email protected] install C:\try1\node_modules\socket.io\node_modules\engin e.io\node_modules\ws\node_modules\utf-8-validate node-gyp rebuild

C:\try1\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modul es\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Program Files\nod ejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp. js" rebuild ) else (node rebuild ) Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. 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 Visua l Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [C:\try1\node_modules\socket.io\node_modules\engine.io \node_modules\ws\node_modules\utf-8-validate\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\nodejs\node_modules
npm\node_modules\node-gyp\lib\build.js:270:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces s.js:200:12) gyp ERR! System Windows_NT 6.3.9600 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\try1\node_modules\socket.io\node_modules\engine.io\node_modules
ws\node_modules\utf-8-validate gyp ERR! node -v v4.2.2 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok

[email protected] install C:\try1\node_modules\socket.io\node_modules\engine.io \node_modules\ws\node_modules\bufferutil node-gyp rebuild

C:\try1\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modul es\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs
node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild ) Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. 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 Visua l Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [C:\try1\node_modules\socket.io\node_modules\engine.io \node_modules\ws\node_modules\bufferutil\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\nodejs\node_modules
npm\node_modules\node-gyp\lib\build.js:270:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces s.js:200:12) gyp ERR! System Windows_NT 6.3.9600 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\try1\node_modules\socket.io\node_modules\engine.io\node_modules
ws\node_modules\bufferutil gyp ERR! node -v v4.2.2 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok npm WARN optional dep failed, continuing [email protected] npm WARN optional dep failed, continuing [email protected]

[email protected] install C:\try1\node_modules\socket.io\node_modules\socket.io -client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil node-gyp rebuild


C:\try1\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine .io-client\node_modules\ws\node_modules\bufferutil>if not defined npm_config_nod e_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\no de_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild ) Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. 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 Visua l Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [C:\try1\node_modules\socket.io\node_modules\socket.io -client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil\b -uild\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\nodejs\node_modules
npm\node_modules\node-gyp\lib\build.js:270:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces s.js:200:12) gyp ERR! System Windows_NT 6.3.9600 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\try1\node_modules\socket.io\node_modules\socket.io-client\node_m odules\engine.io-client\node_modules\ws\node_modules\bufferutil gyp ERR! node -v v4.2.2 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok

[email protected] install C:\try1\node_modules\socket.io\node_modules\socke t.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-val idate node-gyp rebuild

| |

.io-client\node_modules\ws\node_modules\utf-8-validate>if not defined npm_config _node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin... .\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild ) Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. 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 Visua l Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [C:\try1\node_modules\socket.io\node_modules\socket.io -client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-valida te\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\nodejs\node_modules
npm\node_modules\node-gyp\lib\build.js:270:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces s.js:200:12) gyp ERR! System Windows_NT 6.3.9600 ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs
node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\try1\node_modules\socket.io\node_modules\socket.io-client\node_m odules\engine.io-client\node_modules\ws\node_modules\utf-8-validate gyp ERR! node -v v4.2.2 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok npm WARN optional dep failed, continuing [email protected] npm WARN optional dep failed, continuing [email protected] [email protected] node_modules\socket.io ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], socket.io-parser@2. 2.2) ├── [email protected] ([email protected], [email protected], [email protected], [email protected] .0) └── [email protected] ([email protected], [email protected], [email protected], componen [email protected], [email protected], [email protected], [email protected], has [email protected], [email protected], [email protected])

Moytri avatar Nov 17 '15 17:11 Moytri

I, too, just ran into this. Installing VS2015 now. --- fixed it

black-snow avatar Dec 06 '15 22:12 black-snow

me too, same error happened when typing command: npm start

mizhon avatar Dec 30 '15 05:12 mizhon