Skip to content
This repository has been archived by the owner on Sep 11, 2021. It is now read-only.

Could not install Visual Studio Build Tools #152

Open
Villan-98 opened this issue Oct 22, 2018 · 45 comments
Open

Could not install Visual Studio Build Tools #152

Villan-98 opened this issue Oct 22, 2018 · 45 comments

Comments

@Villan-98
Copy link

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

@pdavis68
Copy link

I'm getting this same issue.

@Exlord
Copy link

Exlord commented Oct 24, 2018

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

@ridakk
Copy link

ridakk commented Oct 24, 2018

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

@takase1121
Copy link

I also faced this problem.

use 4.0.0 for now. The latest seems to be bugged

@awedev
Copy link

awedev commented Oct 29, 2018

+1

@RossPfeiffer
Copy link

Damn

@LuKaXiya
Copy link

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

@refack
Copy link

refack commented Nov 28, 2018

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 doc: updating vs cpp build tool installation steps in building nodejs/node#24462 (comment)
    (The "Visual C++ build tools" workload + the "Python 2" and "Git for Windows" individual components)
  2. The new install_tools.bat from win: do not use Boxstarter to install tools 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

@hmmhmmhm
Copy link

hmmhmmhm commented Dec 3, 2018

Just use it simply
It'll be work very smoothly

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

@LuKaXiya
Copy link

LuKaXiya commented Jan 16, 2019 via email

@srlowe
Copy link

srlowe commented Jan 16, 2019

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

@LuKaXiya
Copy link

LuKaXiya commented Jan 16, 2019 via email

@chris-envas
Copy link

me too, how to deal with it

@alexdevero
Copy link

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

@mithundas79
Copy link

Just use it simply
It'll be work very smoothly

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

the savior

@giegiey
Copy link

giegiey commented May 2, 2019

Just use it simply
It'll be work very smoothly

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

Thanks bro.

@fer626
Copy link

fer626 commented May 7, 2019

Just use it simply
It'll be work very smoothly

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

thanks work very well

@samrueby
Copy link

👍 Also stuck on this.

@dcarter0317
Copy link

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

@ulsting
Copy link

ulsting commented Jun 11, 2019

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

[email protected] postinstall C:\Users\Grant\AppData\Roaming\npm\node_
modules\windows-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!

@hamadgondal
Copy link

Just use it simply
It'll be work very smoothly

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

Thank you ... Works perfectly

@connor4312
Copy link

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

@oshihirii
Copy link

same issue:

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

@Rabindramanohar
Copy link

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

@satishdabilpur
Copy link

satishdabilpur commented Aug 6, 2019

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

@sudha53633
Copy link

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

@satishdabilpur
Copy link

satishdabilpur commented Aug 30, 2019

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.

@dinukasal
Copy link

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

@takase1121
Copy link

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.

@MHICoder15
Copy link

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

[email protected] postinstall C:\Users\M_H_I\AppData\Roaming\npm\node_modules\windows-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..."..???

@jgod
Copy link

jgod commented Oct 17, 2019

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

[email protected] postinstall C:\Users\M_H_I\AppData\Roaming\npm\node_modules\windows-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?

@TheColorRed
Copy link

TheColorRed commented Dec 20, 2019

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

@ihormkl
Copy link

ihormkl commented Feb 17, 2020

  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.

@RGKrish183
Copy link

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:

@PaulRBerg
Copy link

Uninstall Python 3.x and use Python 2.7

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

@takase1121
Copy link

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

@Nimplex
Copy link

Nimplex commented Nov 29, 2020

Same issue
image

@justinjdickow
Copy link

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:\Users\username 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

@olavomello
Copy link

Same here

@CodingMikey
Copy link

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

@TecnicsSelva
Copy link

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

@karlhorky
Copy link

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

@c42-arun
Copy link

c42-arun commented May 3, 2021

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!

@aamirtestable
Copy link

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

@amzbiz
Copy link

amzbiz commented Aug 13, 2021

None of these solutions work for me, Windows 10, Node 12. I'm off to Linux as I can't wait for this to be resolved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests