17

I am trying to install the following module using node.js, but keep on getting the following error. Do you have any suggestions on what I should do? So I am using windows 7 and have installed .NET Framework 2.0 SDK as well.

npm install execSync

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.
anonymous123
  • 1,271
  • 6
  • 19
  • 43

8 Answers8

10

You need to add VCBuild.exe to your path. Check out this answer on how to do it: Testacular install fails, no vcbuild.exe

Community
  • 1
  • 1
verybadalloc
  • 5,768
  • 2
  • 33
  • 49
  • 1
    Thanks that worked, but now I am getting the following error d:\users\hduser\.node-gyp\0.10.12\deps\uv\include\uv-private/uv-win.h(32): fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory [D:\Users\hduser\node_modules\ffi\node_modules\ref\build\binding.sln] – anonymous123 Jul 05 '13 at 20:24
  • 1
    Did you try this: http://stackoverflow.com/questions/3623129/winsock2-h-no-such-file-or-directory? – verybadalloc Jul 06 '13 at 04:38
  • thanks @verybadalloc this answer worked, its really messy the way node.js is on windows. – anonymous123 Jul 08 '13 at 21:13
  • I don't have the file path C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages, perhaps because I'm using 8.0? I created the file path C:\Program Files (x86)\Microsoft Visual Studio 8.0\VC\vcpackages\vcbuild.exe but it didn't solve the problem. – maudulus Sep 18 '14 at 17:10
8

The easiest way is to install a trial version of visual studio and run npm in the visual studio command prompt as administrator. Visual studio 2012 does the job.

Jean-Philippe Leclerc
  • 6,713
  • 5
  • 43
  • 66
  • I have encountered this error a couple of times and never (re)installed any components to fix it.Unfortunately I cannot recall how to solve it any more; i am currently facing the issue again. Nevertheless I checked it and python, Visual C++ and all the other stuff mentioned in this or other answers were installed on my PC anyways. – keinabel Oct 23 '18 at 09:15
4
npm install -g windows-build-tools

ran in an administration window and we will see:

Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!
Waiting for installers... -Successfully installed Python 2.7
Waiting for installers... /Successfully installed Visual Studio Build Tools.
Eka putra
  • 739
  • 10
  • 15
2
 npm install --global --production windows-build-tools

will resolve 90% of the install issues in windows for node

SUHAS REKHU
  • 3,363
  • 2
  • 10
  • 13
1

This steps helped me a lot:

"According to the readme file in Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1, to ensure that your system has a supported configuration, uninstall the following products and then reinstall them in the order listed:"

1 - Visual C++ 2010 Express or Visual Studio 2010
2 - Windows SDK 7.1 Note: If you get error on installation, maybe this link will help you.
3 - Visual Studio 2010 SP1
4 - Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1

For me, only the step two was enough. Pay attention in second step's note "Note: If you get error on installation, maybe this link will help you". I had problem and this tip was important.

For more information, this link can be useful: https://github.com/TooTallNate/node-gyp/wiki/Visual-Studio-2010-Setup

John Saunders
  • 160,644
  • 26
  • 247
  • 397
0

After trying various .Net and Visual I finally managed to get npm to load and build mongoose on Windows 8.1 by downloading Visual Studio 2013 Prof

ftp://ftp.microsoft.com/bussys/winsock/winsock2/qos.h

0

Interestingly, even after installing Visual Studio 2015 and adding the path to VCBuild.exe to Environment Variables -> PATH, this error was occuring when i tried to npm install. Restarting the machine didn't resolve the error. I tried starting the app using node app.js and it works!

Vinay Vemula
  • 3,855
  • 1
  • 21
  • 24
0

This command will add necessary packages.

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

Daniyal
  • 690
  • 6
  • 10