npm install error - MSB3428: Could not load the Visual C++ component "VCBuild.exe"

node.js

node.js Problem Overview


I'm trying to use the

npm install steam

but I am getting an error saying

error

I'm not sure how to fix this and I have gotten this on two different npm module installs. I can install other modules however.

What I have tried: Install whatever dependencies it needs. (ursa, node-gyp etc) Install Visual C++ 2005. Install Visual C++ 2010. Change the enviroment variable path to /VC/ (found on another StackOverflow thread/question. Googled, googled & googled.

I also get an error trying do:

npm install ursa

The error is:

error2

node.js Solutions


Solution 1 - node.js

Try this from cmd line as Administrator

optional part, if you need to use a proxy:

set HTTP_PROXY=http://login:password@your-proxy-host:your-proxy-port
set HTTPS_PROXY=http://login:password@your-proxy-host:your-proxy-port

run this:

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

No need for Visual Studio. This has what you need.

References:

https://www.npmjs.com/package/windows-build-tools
https://github.com/felixrieseberg/windows-build-tools

Solution 2 - node.js

I know it's a very old question, but is the first in my google search and after some time I got how to solve this.

find node on your windows with:
as @janaka-bandara suggested you can use the native
where node
if you don't have it for some reason you can install which with node
$ npm install -g which
$ which node
after cd into the directory, inside the directory cd into node_modules\npm folder and finally:
$ npm install node-gyp@latest
here worked, the answer is from this site

Solution 3 - node.js

It's mentioned in the Documentation clearly as below: https://github.com/nodejs/node-gyp#installation

Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).

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

Solution 4 - node.js

Look at the installation instructions for node-gyp - you can't just npm install node-gyp. I see you've installed Visual C++, but there's more to it.

What version of windows do you have? If I knew that I might be able to tell you which part of the node-gyp instructions you didn't do, but check them out and you should be able to figure it out. I've gone through a bit of pain for this stuff too.

Solution 5 - node.js

I tried the above suggested npm install --global --production windows-build-tools but found that the installation was always hanging forever.

I managed to fix the problem by installing Node.js 8 instead of Node.js 10.

Solution 6 - node.js

Just to add to the above answer, anyone finding an issue of the installers taking forever, I found my issue was python, I uninstalled both my versions 3 and versions 2.

The re-ran the command in PowerShell terminal as the admin and it installed almost straight away.

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

Solution 7 - node.js

PLEASE FOLLOW THE FLOW CORRECTLY WINDOWS 10x64

  1. Powershell run as administrator
  2. npm install -g node-gyp
  3. npm install --global --production windows-build-tools

Solution 8 - node.js

For me worked install the component "VCBuild.exe", just dowload the wizard, install and them open the cmd again as administrator and try run again. Updated link to dowload the wizard https://www.microsoft.com/en-us/download/confirmation.aspx?id=48159">here</a>

Solution 9 - node.js

Tried npm install mongoose --msvs_version=2012, if you have multiple Visual installed, it worked for me

Solution 10 - node.js

The problems here are to do with the npm node-gyp module

I found the solutions offered on the build page for that project effective.

node-gyp page on github

There's a fully automatic way and a manual way.

Solution 11 - node.js

As Matt said (https://stackoverflow.com/a/43323045/2767413) you should install the build-tools for windows. However, I did it via cmd and got an error, although I am the administrator -

Please restart this script from an administrative PowerShell!
The build tools cannot be installed without administrative rights.
To fix, right-click on PowerShell and run "as Administrator".

I got the same error via a PowerShell.

For windows 7, the administrative PowerShell can be found under:

Control Panel -> System and Security -> Administrative Tools -> Windows PowerShell Modules

Solution 12 - node.js

I tried running the following commands but the PowerShell instance ends up hanging/freezing:

npm install -g node-gyp
npm install --global --production windows-build-tools 

Therefore, instead of running the app on Windows I transferred over the application to a Ubuntu VM instance and was able to run npm install with no issues.

So if none of the above solutions work and if you don't mind working in a Linux environment, then try creating a Linux VM and porting over your codebase onto it. Then run npm install and see if it works.

Solution 13 - node.js

I managed to get it working by following Option 2 on the Windows installation instructions on the following page: https://github.com/nodejs/node-gyp.

I had to close the current command line interface and reopen it after doing the installation on another one logged in as Administrator.

Solution 14 - node.js

For those the above answer does not work, here is another possible solution to look at.

Issue: On installing npm os-service package i was getting below error error MSB4019: The imported project "d:\M icrosoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct

Even the installation of build tools or VS 2015 did not work for me. So I tried installing below directly via PowerShell (as admin)

https://chocolatey.org/packages/visualcpp-build-tools/14.0.25420.1 Command: choco install visualcpp-build-tools --version 14.0.25420.1

Once this was installed, set an environment variable VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140

Then installation of the package worked perfectly fine after these.

Solution 15 - node.js

i know this is old, i actually just had the same issue. i was able to solve it by running npm install -g node-gyp and fixed! npm

Solution 16 - node.js

npm install --global windows-build-tools

just run this command via powershell (right click and run as administrator!)

worked for me..

Solution 17 - node.js

1)install "lite server" and then try below command :
npm run lite

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionprkView Question on Stackoverflow
Solution 1 - node.jsMattView Answer on Stackoverflow
Solution 2 - node.jsEdu RuizView Answer on Stackoverflow
Solution 3 - node.jsnsdevarajView Answer on Stackoverflow
Solution 4 - node.jsB TView Answer on Stackoverflow
Solution 5 - node.jsGabe SidlerView Answer on Stackoverflow
Solution 6 - node.jsdarloView Answer on Stackoverflow
Solution 7 - node.jsHarshan MorawakaView Answer on Stackoverflow
Solution 8 - node.jsPedro Henrique SilvaView Answer on Stackoverflow
Solution 9 - node.jsAKID AhmedView Answer on Stackoverflow
Solution 10 - node.jsKarl HortonView Answer on Stackoverflow
Solution 11 - node.jso.zView Answer on Stackoverflow
Solution 12 - node.jsflyingfishcattleView Answer on Stackoverflow
Solution 13 - node.jsLeonard CremerView Answer on Stackoverflow
Solution 14 - node.jsSorabh MendirattaView Answer on Stackoverflow
Solution 15 - node.jsBenjamin IniView Answer on Stackoverflow
Solution 16 - node.jsAniket MukherjeeView Answer on Stackoverflow
Solution 17 - node.jsEr Vipin SharmaView Answer on Stackoverflow