32

The command I used (run as administrator):

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

screen shot

GavinR
  • 6,094
  • 7
  • 33
  • 44
Elias Ferede
  • 421
  • 1
  • 4
  • 5

6 Answers6

38

I also faced the same problem and I tried with the below command, it worked.

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

Regards, venkatesh.

Remi Guan
  • 21,506
  • 17
  • 64
  • 87
3

I am running into the issue above. After google, I luckily find a related thread on github about how to resolve stuck when installing windows-build-tool with npm from powershell on Windows. The following are a bunch of screenshots.

screenshot

liuliang
  • 395
  • 1
  • 3
  • 14
3

Spot On!!

You can simply hit below command:

npm install --global windows-build-tools@4.0.0

It will work for sure. Thanks

Gajanan Kulkarni
  • 697
  • 6
  • 22
1

I was experiencing this issue and solved it by following this guide: https://spin.atomicobject.com/2019/03/27/node-gyp-windows/

LJD
  • 498
  • 4
  • 11
1

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

choco install python visualstudio2017-workload-vctools -y

Credits to karlhorky

dzona
  • 3,323
  • 3
  • 31
  • 47
0

OS: Windows 11 Pro

Tried these, but any of them didn't work for me:

  • npm install --global windows-build-tools
  • npm install --global windows-build-tools@4.0.0
  • npm install --global windows-build-tools@5.0.0
  • npm install --global --production windows-build-tools
  • npm install --global --production windows-build-tools@4.0.0
  • npm install --global --production windows-build-tools@5.0.0
  • npm config set msvs_version 2015 global
  • npm config set msvs_version 2017 global

Then Install Chocolatey https://chocolatey.org/install

Followd this resource: https://github.com/felixrieseberg/windows-build-tools/issues/172#issuecomment-824916268

$ choco install python visualstudio2017-workload-vctools -y
$ npm config set msvs_version 2017

Got this error when run $ npm i

Error: 'cmake' is not recognized as an internal or external command,   operable program or batch file.

Solution:

$ choco uninstall cmake
$ choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'

Now I don't get any errors when run $ npm i

Nisal Gunawardana
  • 1,345
  • 16
  • 20