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

Created on 13 Aug 2013  ·  84Comments  ·  Source: nodejs/node-gyp

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

> [email protected] 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!     <[email protected]>

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
Waiting For Input Windows

Most helpful comment

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

All 84 comments

Were yo able to close this?

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.

I get a similar error when trying "npm install msgpack":

PS C:\projects\klarna-test> npm install msgpack
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm http GET https://registry.npmjs.org/msgpack
npm http 200 https://registry.npmjs.org/msgpack

> [email protected] 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.

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?

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

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.

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?

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.

Hahah. Windows is as Important as PHP. :P

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

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

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

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

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

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

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.

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

C:\try1>npm install --save socket.[email protected]

[email protected] 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

[email protected] 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 [email protected]
npm WARN optional dep failed, continuing [email protected]

[email protected] 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

[email protected] 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 [email protected]
npm WARN optional dep failed, continuing [email protected]
socket.[email protected] node_modules\socket.io
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── socket.[email protected] ([email protected], [email protected], [email protected],
[email protected], [email protected])
├── socket.[email protected] ([email protected], [email protected], socket.io-parser@2.
2.2)
├── engine.[email protected] ([email protected], [email protected], [email protected], [email protected]
.0)
└── socket.[email protected] ([email protected], [email protected], [email protected], componen
[email protected], [email protected], [email protected], [email protected], has
[email protected], [email protected], [email protected])

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

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

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 https://github.com/karma-runner/karma/issues/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.

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

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

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

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

@black-snow VS2013 now but tried 2015 before with the same end result.

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

http://stackoverflow.com/questions/39746619/how-do-i-resolve-the-npm-ms-build-issues - I still face this issue!
Also, I had npm install --global --production windows-build-tools done this and but, it installed VS 2015, my project needs 2013

Hi @salangar, what edition of VS2013 do you have installed?

@digitalinfinity I have installed wdexpressfull (VS express 2013). And now I get the below error:

node-pre-gyp ERR! Tried to download: https://node-inspector.s3.amazonaws.com/deb
ug/v0.4.6/node-v11-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected].
36 (node-v11 ABI) (falling back to source compile with node-gyp)

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targe
ts(308,5): error MSB3491: Could not write lines to file "Release\obj\action_aft
er_build\action_a.AA61F24C.tlog\action_after_build.lastbuildstate". The specifi
ed path, file name, or both are too long. The fully qualified file name must be
less than 260 characters, and the directory name must be less than 248 charact
ers. [D:\Users\salangar\Projects\xxx\node_modules\grunt-node-inspector\node_modules\node-inspector\nod
e_modules\v8-debug\build\action_after_build.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe fail
ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\salangar\AppData\Roaming\nvm
\v0.10.36\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:
12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Users\salangar\AppData\Roaming\nvm\v0.10.36\n

@salangar You are hitting the Windows path length limitation. npm 3 flattens the node_modules directory as much as possible so that may help. Alternatively, you can try to map your top-level project directory to a drive (e.g. Z:) so the paths get shorter.

By the way, I see you are using node.js v0.10.36. Consider upgrading; the v0.10 release line is nearing its end-of-life and with v0.10.36 specifically, you are a year and a half behind on security fixes.

@bnoordhuis Yes! that helped. Thanks. I will soon be upgrading node from 0.10.x.

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.

hey, the same issue.

visual c++ build tools are installed, so nmake is available,
in addition VS17 RC is also installed, so that means that MSBuild.exe is also there.

do you use NMake.exe or MSBUild.exe?

upd: I see vcbuild.exe is in use, why? it's not a part of VS/VC Build Tools kit.
does it means that I have to install whole Studio just for a building ? instead of the using VC command line toolchain available from Microsoft and specially designed for a building only?
latest version (VS17) doesn't contain this tool (vcbuild.exe) too, this mean this way is depricated

Same problems here with first VS2015 then VS2017 installed on Win10.

Tried a variety of nodes in both 32 and 64 bit, latest using node 7.2.0.

In my control panel I have C++ redistributable versions 2010, 2013 & vNext which hasn't helped.

Also added MSBuild.exe to the path for the .NET 2.0 & 4.0.

Currently trying the msbuild tools via npm which is a PITA as I'm a MS developer my trade and should already have everything under the sun!

EDIT: Managed to fix this by updating node-sass from the 3.4.2 version ember wanted to 3.13.0 and re-installing. Presume the older node-sass causes grief with newer systems

Just trying @pablorsk solution and got this.

PS D:\Workspaces\personal\codes\laravel-project> npm install --global --production windows-build-tools
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\feryardiant\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--global" "--production" "windows-build-tools"
npm ERR! node v7.6.0
npm ERR! npm  v4.3.0

npm ERR! Cannot read property 'path' of null
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\feryardiant\AppData\Roaming\npm-cache\_logs\2017-03-10T09_08_05_768Z-debug.log

when I follow along the readme and install windows build tools manually (not Visual Studio) and the errors is gone.

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

Worked great for me. Thanks.

i have run this command and it is showing me waitging for installers line from past half an hour .Can you tell me how much time will it take?

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

都是老外

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

I tried to do npm install --global --production windows-build-tools but it's running forever and I am getting an error alongside powershell stopped working.
Please help

@himanshujobletics I suggest raising an issue in the module's repo https://github.com/felixrieseberg/windows-build-tools/issues

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

好多依赖,,,,,,不喜欢

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

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

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.

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**

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

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.

Worked for me too ! Thanks !

Adding windows-build-tools didn't help. That installation failed on me completely after sucking up 1GB of data and wasting my time.

Finally I figured out, I need to install the @latest version of the packages and update the dependency version.

npm i ember-cli-sass@latest ember-frost-core@latest ember-frost-tabs@latest ember-tooltips@latest --save-dev
             -- OR --
npm i ember-cli-sass@latest --save-dev
npm i ember-frost-core@latest --save-dev
npm i ember-frost-tabs@latest --save-dev
npm i ember-tooltips@latest --save-dev

_(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

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

@jeremysu0131 that worked for me. Thanks!

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

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
Worked for me! Thanks !!!!

好多次遇到类似情况

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

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.

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

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

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

Got error installing [email protected]
Ran
npm install --global --production windows-build-tools
npm uninstall -g composer-cli
npm install -g [email protected]

in that order and it worked.

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.

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.

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

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

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

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

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

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

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

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

@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
+ [email protected]
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
+-- [email protected]
+-- [email protected]
`-- [email protected]

I am still getting the following errors when trying to install ibm-watson:

$ npm install --save ibm-watson

> [email protected] 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 [email protected] license should be a valid SPDX license expression

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\watchpack\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\glob-watcher\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ [email protected]
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

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

> [email protected] 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!

+ [email protected]
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)

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

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

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.

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

> [email protected] 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!

+ [email protected]
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) .

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.

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

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

npm install --global windows-build-tools

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

npm install --global windows-build-tools

it works for me ,thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

halkar picture halkar  ·  4Comments

kimown picture kimown  ·  3Comments

lopezdp picture lopezdp  ·  3Comments

meldsza picture meldsza  ·  3Comments

Sentero-esp12 picture Sentero-esp12  ·  3Comments