0

I'm trying to install a module from npm to use in my project. Altough, everytime I try, I get this message:

MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe".
 If the component is not installed, either 1) install the Microsoft Windows SDK
 for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual
 Studio 2008.  [C:\Users\<name>\Desktop\max-node\control\node_modules\xbox-cont
roller\node_modules\node-hid\build\binding.sln]

I've tried downloading the .NET framework and installing it several times and nothing happens, I've already got the SDK installed.

How do I fix it?

Thanks

- Mackan

Mackan90096
  • 59
  • 2
  • 13

2 Answers2

0

The module you're trying to install (node-hid) uses a binary library requiring compilation for your architecture. From the error message, it appears that MSBUILD cannot locate VCBuild.exe which is probably caused by a missing directory in your PATH environment variable. To set things up correctly, you'll need to

  1. add the location of VCBuild.exe to your PATH environment variable.
  2. npm install -g node-gyp

This will reinstall the node-gyp native extension compiler which, once you add the location of VCBuild.exe to your path, should be able to install any npm module.

See node-gyp for more information.

Also see error MSB3411: Could not l oad the Visual C++ component "VCBuild.exe"

Community
  • 1
  • 1
Rob Raisch
  • 15,416
  • 3
  • 43
  • 55
0

Download Visual Studio Express from here, then simply run the following command:

npm config --global set msvs_version 2015 (assuming you've download VSE 2015)

If you have any further issues, make sure your PATH environment variable includes the location of VCBuild.exe (as described in the previous answer).

Jonathan Gray
  • 2,281
  • 13
  • 20