Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Hao-Wu opened this issue Aug 13, 2013 · 85 comments
Closed

Comments

@Hao-Wu
Copy link

Hao-Wu commented Aug 13, 2013

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
@chinmayrane
Copy link

Were yo able to close this?

@JayBeavers
Copy link
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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

Hahah. Windows is as Important as PHP. :P

@Hao-Wu Hao-Wu closed this as completed Mar 24, 2015
@knightuniverse
Copy link

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

@joshbedo
Copy link

joshbedo commented Jul 1, 2015

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

@Hao-Wu
Copy link
Author

Hao-Wu commented Jul 2, 2015

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.

@Hao-Wu Hao-Wu reopened this Jul 2, 2015
@joshbedo
Copy link

joshbedo commented Jul 2, 2015

@Hao-Wu Yeah i typically use my Mac but the hard drive started failing so i switched over to my windows machine. So i figured out the problem, I installed Visual Studio for the Web which doesn't include a C++ compiler. I uninstalled that version and installed the community version.. now everything seems to be working fine.

@gregjhogan
Copy link

I also had this problem because I had VS 2013 Express for Web installed, which doesn't include the C++ compilers. However, the Windows 7 64-bit SDK does include the C++ compiler (but you have to pick it during the installation process).

@yacineMTB
Copy link

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

@JeffreyBPetersen
Copy link

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

@brokenalarms
Copy link

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.

@Moytri
Copy link

Moytri commented Nov 17, 2015

This occurs when I am going to install socket.io . How to solve it?

C:\try1>npm install --save socket.io@1.3.7

utf-8-validate@1.2.1 install C:\try1\node_modules\socket.io\node_modules\engin
e.io\node_modules\ws\node_modules\utf-8-validate
node-gyp rebuild

C:\try1\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modul
es\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Program Files\nod
ejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.
js" rebuild ) else (node 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 Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere. [C:\try1\node_modules\socket.io\node_modules\engine.io
\node_modules\ws\node_modules\utf-8-validate\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 (C:\Program Files\nodejs\node_modules
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej
s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\try1\node_modules\socket.io\node_modules\engine.io\node_modules
ws\node_modules\utf-8-validate
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

bufferutil@1.2.1 install C:\try1\node_modules\socket.io\node_modules\engine.io
\node_modules\ws\node_modules\bufferutil
node-gyp rebuild

C:\try1\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modul
es\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs
node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js"
rebuild ) else (node 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 Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere. [C:\try1\node_modules\socket.io\node_modules\engine.io
\node_modules\ws\node_modules\bufferutil\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 (C:\Program Files\nodejs\node_modules
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej
s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\try1\node_modules\socket.io\node_modules\engine.io\node_modules
ws\node_modules\bufferutil
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.2.1
npm WARN optional dep failed, continuing bufferutil@1.2.1

bufferutil@1.2.1 install C:\try1\node_modules\socket.io\node_modules\socket.io
-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil
node-gyp rebuild


C:\try1\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine
.io-client\node_modules\ws\node_modules\bufferutil>if not defined npm_config_nod
e_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\no
de_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node 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 Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere. [C:\try1\node_modules\socket.io\node_modules\socket.io
-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil\b
-uild\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 (C:\Program Files\nodejs\node_modules
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej
s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\try1\node_modules\socket.io\node_modules\socket.io-client\node_m
odules\engine.io-client\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

utf-8-validate@1.2.1 install C:\try1\node_modules\socket.io\node_modules\socke
t.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-val
idate
node-gyp rebuild

|
|

.io-client\node_modules\ws\node_modules\utf-8-validate>if not defined npm_config
_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin...
.\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node 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 Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere. [C:\try1\node_modules\socket.io\node_modules\socket.io
-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-valida
te\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 (C:\Program Files\nodejs\node_modules
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.3.9600
ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs
node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\try1\node_modules\socket.io\node_modules\socket.io-client\node_m
odules\engine.io-client\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing bufferutil@1.2.1
npm WARN optional dep failed, continuing utf-8-validate@1.2.1
socket.io@1.3.7 node_modules\socket.io
├── debug@2.1.0 (ms@0.6.2)
├── has-binary-data@0.1.3 (isarray@0.0.1)
├── socket.io-parser@2.2.4 (isarray@0.0.1, debug@0.7.4, component-emitter@1.1.2,
benchmark@1.0.0, json3@3.2.6)
├── socket.io-adapter@0.3.1 (object-keys@1.0.1, debug@1.0.2, socket.io-parser@2.
2.2)
├── engine.io@1.5.4 (base64id@0.1.0, debug@1.0.3, engine.io-parser@1.2.2, ws@0.8
.0)
└── socket.io-client@1.3.7 (to-array@0.1.3, debug@0.7.4, indexof@0.0.1, componen
t-bind@1.0.0, backo2@1.0.2, object-component@0.0.3, component-emitter@1.1.2, has
-binary@0.1.6, parseuri@0.0.2, engine.io-client@1.5.4)

@black-snow
Copy link

I, too, just ran into this. Installing VS2015 now. --- fixed it

@mizhon
Copy link

mizhon commented Dec 30, 2015

me too, same error happened when typing command: npm start

@tomhicz
Copy link

tomhicz commented Jan 22, 2016

After running into this error when trying to use Foundation 6's build tool I founf this thread and just spent like an hour installing 11gb of god knows what that I don't need from the community edition.

Then I found this thread karma-runner/karma#536
and, if they are correct, none of that is needed anyway, as it's just for an optional native build, and there is a JS fallback.
So I'm now uninstalling god knows how much MS crap and hoping it hasn't fubared my system.

It seems like the issue here is that the error message is totally misleading. It probably should be a warning not an error, it should probably mention that it's optional and there is a fallback, and it should probably be updated with correct current advice for those who might actually want to install the C++ runtime.

It seems like the errors also caused the installation of node modules to be halted, so I did have to run "npm install" in the folder to get things set up.

If i'm wrong then maybe it is essential for some uses, but either way the error message should probably be updated.

@juberjj
Copy link

juberjj commented May 21, 2016

I'm getting the same problem here. I can't understand why Windows don't offer a better support for this.

I was trying to install a simple package "libxmljs" on a Windows 7 x64, I had initially VS2013 installed + Python27 and it would either complain about MSBuild or something else. Followed a more than a couple of advice, install this uninstall that but no luck.

Now I'm trying it from scratch, newly installed W7 with Net Framework 4.5 installed (see error below), no VS installed but I'm trying to figure if full VS is really necessary as I would't need that so waste of space.

If so, what version because I had 2013 and even 2015 installed and got loads of error but I could not get that package installed.

Any suggestions????

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:\test\node_modules\rhmap-stats\node_modules\stats-influxdb\node_modules\diskusage\node_modules\ref\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

@black-snow
Copy link

@juberjj have you already tried w/ VS2015 (express) installed?

@juberjj
Copy link

juberjj commented May 26, 2016

@black-snow I did indeed and I got the same problem. I had start a new machine altogether with NF 4.5, Python 2.7 and MVS 2013 (all fresh installation).
I don't have a full node package for Windows installed as I would need to switch between versions (long story) so I have NVM and installed versions through NVM.

Node version is 0.10.30 and NPM 1.4.21, but errors would also occur with versions 4.4.2 and 5.3.0.

Also installing a package like libxml-xsd (which I was able to install) MVS spills loads of warning messages, funnily enough I had the same package installed on Ubuntu 16.0 and I had no problem whatsoever.

@black-snow
Copy link

@juberjj What now, did you use VS 2013 or 2015?

@abdufarag
Copy link

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

@gsidler
Copy link

gsidler commented Jun 6, 2018

I tried to above suggested npm install --global --production windows-build-tools, which has been confirmed to work for many. For me it was always hanging.

I finally managed to get this working by installing Node.js 8 instead of Node.js 10. I hope this might save someone some debugging time.

@vanquyettran
Copy link

Installing Visual Studio helped me while npm install --global --production windows-build-tools was not working

https://visualstudio.microsoft.com/vs/community/

@xiMenChuiXui
Copy link

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

@rebase-master
Copy link

Got error installing composer-cli@0.19.5
Ran
npm install --global --production windows-build-tools
npm uninstall -g composer-cli
npm install -g composer-cli@0.19.5

in that order and it worked.

@d3x0r
Copy link

d3x0r commented Aug 1, 2018

Ran into this problem on another system....

found solution in this reply (after trying many others) #307 (comment)

npm config set msvs_version 2015 --global

without installing community IDE.

@tatsujb
Copy link

tatsujb commented Nov 14, 2018

I'm closing this issue since it's 4 years old, and originally refers to to VS2013. It should still be googleable, and I hope it contains helpful information.

it's not googlable. I took ages to find this. node-sass is kicking this old bug back into full gear.

@Vandivier
Copy link

Vandivier commented Feb 4, 2019

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

@pstanton
Copy link

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

@vCillusion
Copy link

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

@printfjoby
Copy link

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

@znnnnn
Copy link

znnnnn commented May 28, 2019

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
Copy link

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

@oshihirii
Copy link

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

@d3x0r
Copy link

d3x0r commented Jul 14, 2019

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

@oshihirii
Copy link

@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
Copy link

oshihirii commented Jul 14, 2019

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
Copy link
Contributor

cclauss commented Jul 14, 2019

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

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

@ghost
Copy link

ghost commented Jan 7, 2020

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
Copy link

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
Copy link

xermus commented May 2, 2020

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
Copy link

ghost commented May 26, 2020

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

@kamalhm
Copy link

kamalhm commented Jul 14, 2020

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

npm install --global windows-build-tools

@Randyshu2018
Copy link

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

npm install --global windows-build-tools

it works for me ,thank you!

@stonestecnologia
Copy link

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
Projects
None yet
Development

No branches or pull requests