StefanScherer / dockerfiles-windows

Various Dockerfiles for Windows Containers
MIT License
1.11k stars 396 forks source link

node-gyp fails to compile headdump package on build-tools image #440

Closed amirhalatzi closed 4 years ago

amirhalatzi commented 4 years ago

I tried installing a node package that depends on heapdump package, but node-gyp fails to find msbuild.

`FROM stefanscherer/node-windows:12.16.1-build-tools

npm i heapdump`

Apparently it should have used the x64 version.

To fix it, I've added the following to the Dockerfile:

ENV VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140" RUN npm config set msbuild_path='C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\msbuild.exe'

Any chance of adding it to the base Dockerfile? Or am I missing something altogether?

StefanScherer commented 4 years ago

Hi @amirhalatzi I haven‘t used this image with node-gyp lately. But your findings seem reasonable to me. Could ould open a pull request with the fix? This reminds me, we could also give the images some version bumps 😅