Skip to content

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

Closed
@Hao-Wu

Description

@Hao-Wu

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

> contextify@0.1.6 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!     <npm-@googlegroups.com>

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

Activity

chinmayrane

chinmayrane commented on Dec 3, 2013

@chinmayrane

Were yo able to close this?

JayBeavers

JayBeavers commented on Dec 6, 2013

@JayBeavers
Contributor

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.

k-j-kleist

k-j-kleist commented on Dec 20, 2013

@k-j-kleist

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

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

> msgpack@0.2.1 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.

chinmayrane

chinmayrane commented on Dec 20, 2013

@chinmayrane

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?

k-j-kleist

k-j-kleist commented on Dec 20, 2013

@k-j-kleist

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

k-j-kleist commented on Dec 20, 2013

@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.

chinmayrane

chinmayrane commented on Dec 20, 2013

@chinmayrane

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?

k-j-kleist

k-j-kleist commented on Dec 20, 2013

@k-j-kleist

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.

chinmayrane

chinmayrane commented on Dec 20, 2013

@chinmayrane

Hahah. Windows is as Important as PHP. :P

knightuniverse

knightuniverse commented on Mar 27, 2015

@knightuniverse

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

joshbedo

joshbedo commented on Jul 1, 2015

@joshbedo

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

Hao-Wu

Hao-Wu commented on Jul 2, 2015

@Hao-Wu
Author

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.

reopened this on Jul 2, 2015

71 remaining items

znnnnn

znnnnn commented on May 28, 2019

@znnnnn

We found the solution, just need run this command as administrator:

# as admin
npm install --global --production windows-build-tools

We try installing/removing a lot of software, but the solution was on documentation all the time :) #488 #307

This saved me

BartusZak

BartusZak commented on Jul 3, 2019

@BartusZak

Have used
npm install --global --production windows-build-tool
and is freezed for about 1h
image

oshihirii

oshihirii commented on Jul 14, 2019

@oshihirii

@BartusZak - i am currently in the 'frozen' stage - does it ever end? and does installation complete successfully?

d3x0r

d3x0r commented on Jul 14, 2019

@d3x0r

@oshihirii Reboot; the VS install had a 'needs to reboot to finish' and nothing reports that.

oshihirii

oshihirii commented on Jul 14, 2019

@oshihirii

@d3x0r - thanks, after 2 hours i restarted, unfortunately errors persist.

Overall, these were my steps:

  1. run powershell as administrator
PS C:\WINDOWS\system32> npm install -g node-gyp
C:\Users\Me\AppData\Roaming\npm\node-gyp -> C:\Users\Me\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js
+ node-gyp@5.0.2
added 98 packages from 67 contributors in 15.392s
  1. run npm install --global --production windows-build-tools and restarted after 2 hours

Below are global packages:

$ npm list -g --depth 0
C:\Users\Me\AppData\Roaming\npm
+-- node-gyp@5.0.2
+-- nodemon@1.18.5
`-- windows-build-tools@5.2.2

I am still getting the following errors when trying to install ibm-watson:

$ npm install --save ibm-watson

> websocket@1.0.29 install C:\Users\Me\Documents\my repo\node_modules\websocket
> (node-gyp rebuild 2> builderror.log) || (exit 0)


C:\Users\Me\Documents\my repo\node_modules\websocket>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" 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 Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.  [C:\Users\Me\Documents\my repo\node_modules\websocket\build\binding.sln]

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:\Users\Me\Documents\my repo\node_modules\websocket\build\binding.sln]

npm WARN showcase@1.0.0 license should be a valid SPDX license expression

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\watchpack\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\glob-watcher\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3 (node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ ibm-watson@4.2.2
added 260 packages from 208 contributors and audited 16661 packages in 37.798s
found 406 vulnerabilities (3 low, 1 moderate, 402 high)
  run `npm audit fix` to fix them, or `npm audit` for details
oshihirii

oshihirii commented on Jul 14, 2019

@oshihirii

update:

i read that uninstalling python might stop the problem with the install "freezing" (link).

so i uninstalled python from windows > remove programs and then ran:

npm uninstall --global --production windows-build-tools
npm install --global --production windows-build-tools

which produced:

PS C:\WINDOWS\system32> npm install --global --production windows-build-tools

> windows-build-tools@5.2.2 postinstall C:\Users\Me\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./dist/index.js

Downloading python-2.7.15.amd64.msi
[============================================>] 100.0% of 20.25 MB (1.29 MB/s)
Downloaded python-2.7.15.amd64.msi. Saved to C:\Users\Me\.windows-build-tools\python-2.7.15.amd64.msi.
Downloading vs_BuildTools.exe
[>                                            ] 0.0% (0 B/s)
Downloaded vs_BuildTools.exe. Saved to C:\Users\Me\.windows-build-tools\vs_BuildTools.exe.

Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!

Status from the installers:
---------- Visual Studio Build Tools ----------
2019-07-14T15:16:19 : Verbose : [InstalledProductsProviderImpl]: Stream was closed
2019-07-14T15:16:19 : Verbose : [InstallerImpl]: Rpc connection was closed.
2019-07-14T15:16:19 : Verbose : [InstallerImpl]: Stream was closed
2019-07-14T15:16:19 : Verbose : [SetupUpdaterImpl]: Rpc connection was closed.
2019-07-14T15:16:19 : Verbose : [SetupUpdaterImpl]: Stream was closed
------------------- Python --------------------


Could not install Visual Studio Build Tools.
Please find more details in the log files, which can be found at
C:\Users\Me\.windows-build-tools

Now configuring Python...

All done!

+ windows-build-tools@5.2.2
added 145 packages from 99 contributors in 56.626s

and uninstalled and re-installed ibm-watson and am getting the same error messages.

The error when installing windows-build-tools seems to be acknowledged here:

felixrieseberg/windows-build-tools#152

Edit

I also tried alternative solution here:

choco install vcbuildtools

But still have same errors when installing ibm-watson re: node-gyp and error MSB3428: Could not load the Visual C++ component "VCBuild.exe".

The only thing that worked for me (ie made the "VCBuild.exe" errors go away) was installing:

NET Framework 2.0 Software Development Kit (SDK) 
cclauss

cclauss commented on Jul 14, 2019

@cclauss
Contributor

found 406 vulnerabilities (3 low, 1 moderate, 402 high)

Holy Moley! Is anyone worried about the 402 high risk vulnerabilities?

ghost

ghost commented on Jan 7, 2020

@ghost

update:

The only thing that worked for me (ie made the "VCBuild.exe" errors go away) was installing:

NET Framework 2.0 Software Development Kit (SDK) 

Note: be aware that the .NET 2.0 SDK installation is SILENT. So there's no UI neither a message, you will think it did nothing but after a few minutes just try your npm install again and it should work.

collectivecloudperu

collectivecloudperu commented on Apr 4, 2020

@collectivecloudperu

actualizar:

Leí que desinstalar Python podría detener el problema con la instalación "congelación" ( enlace ).

así que desinstalé Python de Windows> eliminar programas y luego ejecuté:

npm uninstall --global --production windows-build-tools
npm install --global --production windows-build-tools

que produjo:

PS C:\WINDOWS\system32> npm install --global --production windows-build-tools

> windows-build-tools@5.2.2 postinstall C:\Users\Me\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./dist/index.js

Downloading python-2.7.15.amd64.msi
[============================================>] 100.0% of 20.25 MB (1.29 MB/s)
Downloaded python-2.7.15.amd64.msi. Saved to C:\Users\Me\.windows-build-tools\python-2.7.15.amd64.msi.
Downloading vs_BuildTools.exe
[>                                            ] 0.0% (0 B/s)
Downloaded vs_BuildTools.exe. Saved to C:\Users\Me\.windows-build-tools\vs_BuildTools.exe.

Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!

Status from the installers:
---------- Visual Studio Build Tools ----------
2019-07-14T15:16:19 : Verbose : [InstalledProductsProviderImpl]: Stream was closed
2019-07-14T15:16:19 : Verbose : [InstallerImpl]: Rpc connection was closed.
2019-07-14T15:16:19 : Verbose : [InstallerImpl]: Stream was closed
2019-07-14T15:16:19 : Verbose : [SetupUpdaterImpl]: Rpc connection was closed.
2019-07-14T15:16:19 : Verbose : [SetupUpdaterImpl]: Stream was closed
------------------- Python --------------------


Could not install Visual Studio Build Tools.
Please find more details in the log files, which can be found at
C:\Users\Me\.windows-build-tools

Now configuring Python...

All done!

+ windows-build-tools@5.2.2
added 145 packages from 99 contributors in 56.626s

y desinstalado y reinstalado ibm-watsony recibo los mismos mensajes de error.

El error al instalar windows-build-toolsparece ser reconocido aquí:

felixrieseberg / windows-build-tools # 152

Editar

También probé una solución alternativa aquí :

choco install vcbuildtools

Pero aún tienen los mismos errores al instalar ibm-watsonre: node-gypy error MSB3428: Could not load the Visual C++ component "VCBuild.exe".

Lo único que funcionó para mí (es decir, hizo que los "VCBuild.exe"errores desaparecieran) fue instalar:

NET Framework 2.0 Software Development Kit (SDK) 

Also the solution for me was to install NET Framework 2.0 Software Development Kit (SDK) .

xermus

xermus commented on May 2, 2020

@xermus

Just to let you know how it worked for me:

npm install --global --production windows-build-tools

did the job, but only after I rebooted Windows. I ran the command using Powershell as local Administrator.

ghost

ghost commented on May 26, 2020

@ghost

Thank you @xermus - this also worked for me without having to install the behemoth of Visual Studio Community!

kamalhm

kamalhm commented on Jul 14, 2020

@kamalhm

weird, it worked for me but I dont use the --production flag

npm install --global windows-build-tools

Randyshu2018

Randyshu2018 commented on Jul 22, 2020

@Randyshu2018

weird, it worked for me but I dont use the --production flag

npm install --global windows-build-tools

it works for me ,thank you!

ghost

ghost commented on Apr 12, 2021

@ghost

npm install -g --production windows-build-tools

PowerShell administrator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @refack@k-j-kleist@digitalinfinity@shinank@bnoordhuis

        Issue actions

          MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". · Issue #307 · nodejs/node-gyp