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

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

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 85 (6 by maintainers)

Most upvoted comments

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

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?

Hahah. Windows is as Important as PHP. 😛

I faced similar issue on windows 10 using node 6.7.0 and npm 3.10.3. Npm install gets stuck everytime at node-sass. I already had visual studio installed and i tried many solutions mentioned in this thread and other thread but none worked. Only solution which worked for me was:

 # run in administrator privileged command prompt window 
 npm install --global --production windows-build-tools 

and after that i ran :

 npm update 

which successfully fixed node-sass issue.

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

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.

npm install --global --production windows-build-tools No need for Visual Studio. This has what you need.

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

Worked great for me. Thanks.

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.

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

npm install --global --production windows-build-tools Took 15 minutes to install but worked. Indeed node-sass failing to build on Windows 10 without this.

好多次遇到类似情况

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

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

npm install --global --production windows-build-tools Working for windows 2012 r2, thanks for the solution. Faced the issue while installing the nlp module ‘natural’.

Thank you guys

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

It amazingly worked for me, it took several minutes to install but built successfully my node-sass. Thank you for the solution guys****

why use VC++.NET for developing packages for node ? that doesnt make any sense

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:

https://github.com/felixrieseberg/windows-build-tools/issues/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) 

boggles the mind … i’m trying to write a bloody html/javascript/css application, why do i need c# ?

Likely obvious to some, but you can only fix by npm config set msvs_version ... if you have the appropriate C++ on your system and you specify that version correctly. Quick way to check if so and which version(s): https://community.esri.com/docs/DOC-11365-how-to-determine-installed-net-and-c-runtime-versions

But even if you have the correct file on you system somewhere, permissions can prevent config from working. So only do that as a last resort. I recommend trying this first: npm install --global --production windows-build-tools

Ran into this problem on another system…

found solution in this reply (after trying many others) https://github.com/nodejs/node-gyp/issues/307#issuecomment-364210877

npm config set msvs_version 2015 --global

without installing community IDE.

(This is an update to my comment above.)

Sure it worked to install the latest versions, but then later I discovered that some parts of my project broke. So I had to ditch the latest versions and rollback to the original dependency versions.

Now I’m back at the problem with build tools. Although I have installed Python2 and MSBuild (Visual Studio Build Tools 2015), whenever I try to run npm install MSBuild will spit out an error that I need to upgrade the project (something I cannot do). But finally I managed to solve the problem. See below how I did it:

Assuming you have already installed build tools, which you can either by using windows-build-tools or by downloading it here.

npm config set msvs_version 2015 --global
npm install

Note: The second command should be the one that is failing for you due to MSBuild error. So it could also be something like npm install node-sass or npm rebuild node-sass.

Credits to the first command: https://github.com/nodejs/node-gyp/issues/629#issuecomment-225320227

@epsilon-sajain, I know you’re not still waiting for the answer but for everyone else interested: For me it took 37 minutes.

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

If I want to install in yarn. Is this command correct? yarn global add windows-build-tools

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

npm install --global --production windows-build-tools Worked for me! Thanks !!!

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.

If you are using Windows 10 then try to run commands in PowerShell instead of Command Prompt.

npm install --global --production windows-build-tools After running the above command, I manually installed the installers located in the below path:

C:\Users(username).windows-build-tools\vs_BuildTools.exe

好多依赖,不喜欢

@hxl1314hxl 你有事情要问吗?node的中国人蛮多的。

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

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

npm install --global windows-build-tools

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.

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

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

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

It is attempting to build the binary from the source for your particular system. That’s where things go wrong.

They have binaries available for some systems. It tries to download one, but if one isn’t available for your system it tries to build one using VC++. But the problem is VC++ wants you to upgrade the project. The solution (my last comment) is to force VC++ to build the project without upgrading.

This is what I understood.

“npm install --global --production windows-build-tools” solved for me. Thanks.

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.