Windows-build-tools: Could not install Visual Studio Build Tools

Created on 22 Oct 2018  ·  44Comments  ·  Source: felixrieseberg/windows-build-tools

PS C:\Windows\system32> npm install -g windows-build-tools

> [email protected] postinstall C:\Users\sachi\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./dist/index.js



Downloading vs_BuildTools.exe
[>                                            ] 0.0% (0 B/s)
Downloaded vs_BuildTools.exe. Saved to C:\Users\sachi\.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 ----------
2018-10-20T08:56:31 : Verbose : [InstallerImpl]: Rpc connection was closed.
2018-10-20T08:56:31 : Verbose : [InstallerImpl]: Stream was closed
2018-10-20T08:56:31 : Verbose : [SetupUpdaterImpl]: Rpc connection was closed.
2018-10-20T08:56:31 : Verbose : [SetupUpdaterImpl]: Stream was closed
2018-10-20T08:56:32 : Verbose : Restarting the system after an installation operation.
------------------- Python --------------------
Python 2.7.15 is already installed, not installing again.


Could not install Visual Studio Build Tools.
Please find more details in the log files, which can be found at
C:\Users\sachi\.windows-build-tools

Skipping configuration: No configuration for Python or Visual Studio Build Tools required.
TypeError: Cannot read property 'then' of undefined
    at install_1.install (C:\Users\sachi\AppData\Roaming\npm\node_modules\windows-build-tools\dist\start.js:19:17)
    at launch_1.launchInstaller.then.then.then (C:\Users\sachi\AppData\Roaming\npm\node_modules\windows-build-tools\dist\install\index.js:34:9)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
+ [email protected]
added 143 packages in 39.518s

node version- 8.11
os: windows 10
npm version- 5.6

Most helpful comment

Just use it simply
It'll be work very smoothly

npm install --global --production [email protected]

All 44 comments

I'm getting this same issue.

same here
node 8.12
os: windows 10
npm version- 6.4

same here

Skipping configuration: No configuration for Python or Visual Studio Build Tools required.
TypeError: Cannot read property 'then' of undefined
    at install_1.install (D:\Users\kgoktas\AppData\Roaming\nvm\v8.12.0\node_modules\windows-build-tools\dist\start.js:19:17)
    at launch_1.launchInstaller.then.then.then (D:\Users\kgoktas\AppData\Roaming\nvm\v8.12.0\node_modules\windows-build-tools\dist\install\index.js:34:9)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
+ [email protected]
added 143 packages from 96 contributors in 11.84s

λ node -v
v8.12.0
λ npm -v
6.4.1

I also faced this problem.

use 4.0.0 for now. The latest seems to be bugged

+1

Damn

same here
npm -version
6.4.1
windows 10
node -v
v10.13.0

To those who are looking for an alternative way to get your machine set up, the Node.js project is working with Microsoft on a recipe for installing the required build toolchain (admittedly it's hard to get this one right). ATM we have two fairly decent suggestions:

  1. Install the MS VS2017 Community Edition as described in https://github.com/nodejs/node/pull/24462#discussion_r234450133
    (The "Visual C++ build tools" workload + the "Python 2" and "Git for Windows" individual components)
  2. The new install_tools.bat from https://github.com/nodejs/node/pull/24677
    Which is just: Install chocolatey, and run choco upgrade python2 visualstudio2017-workload-vctools.
    Or in script form:
    cmd "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command Start-Process '%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe' -ArgumentList '-NoProfile -InputFormat None -ExecutionPolicy Bypass -Command iex ((New-Object System.Net.WebClient).DownloadString(''https://chocolatey.org/install.ps1'')); choco upgrade -y python2 visualstudio2017-workload-vctools; Read-Host ''Type ENTER to exit'' ' -Verb RunAs

Just use it simply
It'll be work very smoothly

npm install --global --production [email protected]

Thanks,it's done. just use
npm install --global --production [email protected]

At 2019-01-14 15:27:45, "bgSosh" notifications@github.com wrote:

3 months - what's going on guys?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@LuKaXiya Apologies - that was a bit terse, I was having a bad day bad 😩

Someone gave me this solution, you can give it a try.

To those who are looking for an alternative way to get your machine set up, the Node.js project is working with Microsoft on a recipe for installing the required build toolchain (admittedly it's hard to get this one right). ATM we have two fairly decent suggestions:

Install the MS VS2017 Community Edition as described in nodejs/node#24462 (comment)
(The "Visual C++ build tools" workload + the "Python 2" and "Git for Windows" individual components)
The new install_tools.bat from nodejs/node#24677
Which is just: Install chocolatey, and run choco upgrade python2 visualstudio2017-workload-vctools.
Or in script form:
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command Start-Process '%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe' -ArgumentList '-NoProfile -InputFormat None -ExecutionPolicy Bypass -Command iex ((New-Object System.Net.WebClient).DownloadString(''https://chocolatey.org/install.ps1'')); choco upgrade -y python2 visualstudio2017-workload-vctools; Read-Host ''Type ENTER to exit'' ' -Verb RunAs

在 2019-01-16 17:58:17,"bgSosh" notifications@github.com 写道:

@LuKaXiya Apologies - that was a bit terse, I was having a bad day bad 😩


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

me too, how to deal with it

I am also experiencing this issue with v5.1.0. Installation hangs and never finishes. Installing v4.0.0 worked.

Just use it simply
It'll be work very smoothly

npm install --global --production [email protected]

the savior

Just use it simply
It'll be work very smoothly

npm install --global --production [email protected]

Thanks bro.

Just use it simply
It'll be work very smoothly

npm install --global --production [email protected]

thanks work very well

👍 Also stuck on this.

Thank you so much, npm install --global --production [email protected]
did the trick.

I tried npm install --global --production [email protected] and got:

[email protected] postinstall C:\Users\Grant\AppData\Roaming\npm\node_
moduleswindows-build-tools
node ./dist/index.js
build-tools-log.txt

Downloading python-2.7.14.amd64.msi
[> ] 0.0% (0 B/s)
Downloaded python-2.7.14.amd64.msi. Saved to C:\Users\Grant.windows-build-tools
\python-2.7.14.amd64.msi.
Downloading BuildTools_Full.exe
[> ] 0.0% (0 B/s)
Downloaded BuildTools_Full.exe. Saved to C:\Users\Grant.windows-build-tools\Bui
ldTools_Full.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 ----------
Successfully installed Visual Studio Build Tools.
---------- Visual Studio Build Tools ----------
Successfully installed Visual Studio Build Tools.
------------------- Python --------------------
Successfully installed Python 2.7

Could not install Visual Studio Build Tools.
Please find more details in the log files, which can be found at
C:\Users\Grant.windows-build-tools

Now configuring the Visual Studio Build Tools and Python...

All done!

Just use it simply
It'll be work very smoothly

npm install --global --production [email protected]

Thank you ... Works perfectly

This should be fixed with #183, however that's not been published to npm yet.

same issue:

Windows 10
Node v10.16.0
npm 6.9.0  
[email protected]

Thank you, npm install --global --production [email protected] is worked for me.

I am using below NPM versions

Npm - 6.9.0
Node - 10.16.0

While installing below command, still seeing Could not install Visual Studio Build Tools. issue. How to resolve this?

npm install -g --production [email protected]

image

And from the build-logs, I found below exception

MUX: Exception: Info: Could not download update data.

image

Facing same error with node 10.16.3LTS, windows 7.

Have tried with npm install --global --production [email protected], but not worked.

Kindly do the needful

I am using below NPM versions

Npm - 6.9.0
Node - 10.16.0

While installing below command, still seeing Could not install Visual Studio Build Tools. issue. How to resolve this?

npm install -g --production [email protected]

image

And from the build-logs, I found below exception

MUX: Exception: Info: Could not download update data.

image

I had VS2015 and VS2017 installed. So once VS2015 is uninstalled, it worked perfectly.

All of these solutions didn't work for me, installation gets stuck.
I installed windows build tools manually after downloading & installing the windows 10 sdk iso from here,
https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk

Not to badmouth this package or anything, but maybe try using WSL. Node.js natives on windows is already hard despite this package made it much easier.

PS C:\Windows\system32> npm install -g windows-build-tools
[email protected]

[email protected] postinstall C:\Users\M_H_I\AppData\Roaming\npm\node_moduleswindows-build-tools
node ./dist/index.js

Downloading python-2.7.15.amd64.msi
[> ] 0.0% (0 B/s)
Downloaded python-2.7.15.amd64.msi. Saved to C:\Users\M_H_I.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\M_H_I.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 ----------
Still waiting for installer log file...
------------------- Python --------------------
Successfully installed Python 2.7

Anyone can tell me What's solution is this problem "Still waiting for installer log file..."..???

PS C:\Windows\system32> npm install -g windows-build-tools
[email protected]

[email protected] postinstall C:\Users\M_H_I\AppData\Roaming\npm\node_moduleswindows-build-tools
node ./dist/index.js

Downloading python-2.7.15.amd64.msi
[> ] 0.0% (0 B/s)
Downloaded python-2.7.15.amd64.msi. Saved to C:\Users\M_H_I.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\M_H_I.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 ----------
Still waiting for installer log file...
------------------- Python --------------------
Successfully installed Python 2.7

Anyone can tell me What's solution is this problem "Still waiting for installer log file..."..???

Any progress?

I was able to fix my install by doing these three things (Not sure which action(s) fixed the issue):

  1. Remove C:\Users\<user>\.windows-build-tools
  2. Uninstall Build Tools from Windows Installed Programs
  3. Uninstall Python 3.x and use Python 2.7

Then all I needed to do was: npm i -g windows-build-tools

  1. Uninstall Python 3.x and use Python 2.7

This one was the case (Python 3.7 installed from the Microsoft Store).
Thank you.

npm -v = 6.14
node -v = 10.15.3
os = windows 7 sp1

npm i -g --production windows-build-tools

npm install --global --production [email protected]

still gettting error, could

D:\gulaqWorkspace\api\node_modules\iconv>if not defined npm_config_node_gyp (nod
e "C:\Users\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycl
e\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (no
de "C:\Users\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bi
n\node-gyp.js" rebuild )
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2015
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS valid versions for msvs_version:

Uninstall Python 3.x and use Python 2.7

So what if we need both Python 3.x and Python 2.x?

Uninstall Python 3.x and use Python 2.7

So what if we need both Python 3.x and Python 2.x?

I think what you can do is actually :

  1. Uninstall python 2.*
  2. Install python 3.* and the Python launcher (py)
  3. Install python 2.* again
  4. Use py -3 to use python 3.* and py -2 for python 2.*.

Same issue
image

New to windows so this took a while... Here's what I did to get this working. Including node-gyp and electron rebuild in here as well just in case people are landing here to build native libraries for Electron in windows

  1. Install latest LTS node for windows from https://nodejs.org/en/download/
  2. Go to Add or Remove programs and uninstall any existing visual studio build tools
  3. Open Powershell as Admin
  4. Verify node version is latest node --version
  5. Upgrade npm version npm install -g npm
  6. Remove existing installations of windows build tools and node-gyp npm uninstall -g windows-build-tools node-gyp yarn
  7. Go to C:\Usersusername and remove existing .windows-build-tools and .node-gyp folders
  8. Make sure electron builder is in your dev dependencies
  9. Add "postinstall": "electron-builder install-app-deps" to your package.json scripts object

Install things

npm install --global --production windows-build-tools
npm install --global node-gyp
setx PYTHON $env:USERPROFILE\.windows-build-tools\python27\python.exe
npm config set python $env:USERPROFILE\.windows-build-tools\python27\python.exe
npm install --global yarn
yarn // native deps will be built properly after this step

Same here

I tried npm install --global --production [email protected] but it wasn't working for me I would get error msg "Could not install Visual Studio Build Tools"

I deleted my python using Add or Remove programs on windows. I then deleted .windows-build-tools folder. After running npm install --global --production [email protected] and restarting my computer I got it to work.

thanks @hmmhmmhm

I was able to fix my install by doing these three things (Not sure which action(s) fixed the issue):

  1. Remove C:\Users\<user>\.windows-build-tools
  2. Uninstall Build Tools from Windows Installed Programs
  3. Uninstall Python 3.x and use Python 2.7

Then all I needed to do was: npm i -g windows-build-tools

Really it is working

Another option is to try installing the build tools via Chocolatey instead (use an Administrator command line):

choco install python visualcpp-build-tools -y
npm config set msvs_version 2017

Maybe this should be documented in the readme as an alternative...

Another option is to try installing the build tools via Chocolatey instead (use an Administrator command line):

choco install python visualcpp-build-tools -y
npm config set msvs_version 2017

Maybe this should be documented in the readme as an alternative...

^^ @karlhorky - that worked for me, you're a star!

Another option is to try installing the build tools via Chocolatey instead (use an Administrator command line):

choco install python visualcpp-build-tools -y
npm config set msvs_version 2017

Maybe this should be documented in the readme as an alternative...

^^ @karlhorky - that worked for me, you're a star!

My CI/CD have npm install --global --production [email protected] and your solution just worked with that

Thank you

Was this page helpful?
0 / 5 - 0 ratings