Node-gyp: Visual Studio 2017

Created on 21 Nov 2016  ·  64Comments  ·  Source: nodejs/node-gyp

VS 2017RC1 is out now and has a new installer that allows even finer cherry-picking of the wanted components. What is the minimal set of components that need to be installed for using node-gyp? Could this be added to README?

Most helpful comment

I resolved this issue by doing the following..

  1. Open node-gyp folder (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyp)
  2. Navigate to 'gyppylibgyp'
  3. Open (for editing) MSVersion.py
  4. Search for 'v140' (line 237 in my case) default_toolset='v140'
  5. Change to 'v141' and save default_toolset='v141'
  6. This should change build tools location for VS 2015 to target the VS2017 tools installed, as shown below..
    versions = { '2015': VisualStudioVersion('2015', 'Visual Studio 2015', solution_version='12.00', project_version='14.0', flat_sln=False, uses_vcxproj=True, path=path, sdk_based=sdk_based, default_toolset='v141')

I also performed the above steps within the node_modules folder of the application (although I do not believe this was necessary).

Hopefully that helps someone else.

All 64 comments

Yeah, I've been wondering the same thing, @nodejs/platform-windows, @joaocgreis, @felixrieseberg, @mousetraps can anyone fill us in on details on what's needed from VS 2017 to compile Node addons? Perhaps prepare a PR in anticipation of 2017 going gold?

I have tried getting this to work with VS 2017 for a few days now without success.

Installing just "VC++2017 Compiler Toolset" is not enough and results in an error message from MSBuild that VCBuild.exe could not be found. A search inside the installation directories reveals that VCBuild.exe indeed wasn't installed anywhere. Maybe it is installed as part of .NET Framework?

$ npm i
npm WARN deprecated [email protected]: This package is discontinued. Use lodash@^4.0.0.

> [email protected] install C:\Users\felix\git\Projekte\api\node_modules\lwip
> node-gyp rebuild


C:\Users\felix\git\Projekte\api\node_modules\lwip>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 )
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 MSB3428: Die Visual C++-Komponente "VCBuild.exe" konnte nicht geladen werden. Um dieses Problem zu beheben, installieren Sie
 entweder 1) .NET Framework 2.0 SDK oder 2) Microsoft Visual Studio 2005 oder 3) fügen Sie den Speicherort der Komponente zum Systempfad hin
zu, falls er vom Standardspeicherort abweicht.  [C:\Users\felix\git\Projekte\api\node_modules\lwip\build\binding.sln]
MSBUILD : error MSB3428: Die Visual C++-Komponente "VCBuild.exe" konnte nicht geladen werden. Um dieses Problem zu beheben, installieren Sie
 entweder 1) .NET Framework 2.0 SDK oder 2) Microsoft Visual Studio 2005 oder 3) fügen Sie den Speicherort der Komponente zum Systempfad hin
zu, falls er vom Standardspeicherort abweicht.  [C:\Users\felix\git\Projekte\api\node_modules\lwip\build\binding.sln]
MSBUILD : error MSB3428: Die Visual C++-Komponente "VCBuild.exe" konnte nicht geladen werden. Um dieses Problem zu beheben, installieren Sie
 entweder 1) .NET Framework 2.0 SDK oder 2) Microsoft Visual Studio 2005 oder 3) fügen Sie den Speicherort der Komponente zum Systempfad hin
zu, falls er vom Standardspeicherort abweicht.  [C:\Users\felix\git\Projekte\api\node_modules\lwip\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:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp 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:\Users\felix\git\Projekte\api\node_modules\lwip
gyp ERR! node -v v7.1.0
gyp ERR! node-gyp -v v3.4.0

Setting msvs_version to 2017 results in an "undefined key" error from node-gyp.

Ah, it looks like they're not even prepared for it upstream @ gyp: https://chromium.googlesource.com/external/gyp/+/master/pylib/gyp/MSVSVersion.py#238

cc @digitalinfinity

Heya! I'm at Slack now, but still pretty invested in things being "okay" on Windows. I have a feeling this will be a tough one, but once things are fixed upstream, we should try to get https://github.com/felixrieseberg/windows-build-tools up to par with what'll be needed for most tools.

Not so much interested in installing them from NPM, I just want to know what minimal components I need from the new (leightweight) VS installer

@felixrieseberg Status update?

Is there an issue open at gyp about this?

Sorry, just saw this thread. Not surprising given that both the msbuild resolution scheme and the installer paths have been completely revamped in VS2017, so I suspect we'll, at the very least, need to make some modifications to node-gyp itself to properly locate the path when setting msvs_version. I'll investigate what we need to do to make this work again and report back.

@mousetraps good to see you :)

/cc @kunalspathak who I believe has been looking at VS 2017 support as well.

Sweet! @kunalspathak idk how far you've gotten but happy to drop by this week and pair on it. I'm more familiar with the VS installer now than I ever wanted to be.

Thanks @mousetraps . I haven't started any investigation yet, but would love to learn what it means to fix this.

Is VS2017 even supported by V8?

I don't think so. I believe their waterfall is based on VS 2015 at this point.

is it possible to adopt node-gyp to VS Build Tools only ? without whole studio installation?
previous version (Visual C++ Build Tools 2015) does contain NMake build tool only, I suppose new is the same.

  1. C++ tools v141 in VS 2017 are the same as C++ tools v140 in VS 2015. The minor version was bumped to deal with side-by-side issues. C++ tools v150 will come later.

  2. VCBuild.exe was replaced by MSBuild.exe years ago. LMK if you have trouble migrating to MSBuild.exe--I know people who can advise.

  3. VS 2017 installer lets you install side-by-side VS tools at a very granular level without any global state (no registry keys, etc.) There are command-line options for all installs, but documentation is still a little light in that area.

  4. The factoring of components in VS 2017 is intended such that you can install just what you need (within reason--even if you don't use dumpbin.exe, you still get it with link.exe.) If the factoring of the components is wrong for some reason (i.e., you need just one file from a component), let me know.

@AndrewPardoe

VCBuild.exe was replaced by MSBuild.exe years ago. LMK if you have trouble migrating to MSBuild.exe--I know people who can advise.

I think the error that vcbuild.exe was not found only comes from gyp trying to locate the compiler tool, starting with the newest version and falling back to a lower version until it fails with the error that vcbuild.exe was not found. The issue seems to be that gyp simply does not work with VS 2017 atm.

The recommended way to find a VC++ tools install with VS 2017 is to query a COM server. Heath Stewart, VS Setup guru, gives details and samples here: https://blogs.msdn.microsoft.com/heaths/2016/09/15/changes-to-visual-studio-15-setup/

I'm newbie in node and native add-ons, so from perspective , I don't understand why it relies on vcbuild, instead of msbuild.
Andrew, the question to you as Microsoft compiler developer, as I remember , msbuild is not included into build tools kit. Why? Anyway, I believe the using nmake for gyp would be preferable. Gyp looks unsupported more project, is not it?

@amigo421 Read my previous comment, this is not Microsoft's fault. msbuild is included in the compiler tools installation.

@felixfbecker is right--MSBuild should be there. Regardless, we can support MSBuild, CMake, or NMake if you want to go old school :) Make a technical decision and then look at how the toolset can support it.

Please correct me if I'm wrong, I've tried to use node-gyp with build tools 2015, and the error was there. As I remember msbuild is not included, let me double check this.

This issue is about VS 2017, not 2015. 2015 is working fine.

sorry - I see I'm writing in a topic about VS2017, I mean that my issue that node-gyp was not working for me with Build Tools 2015 only, I had to install VS2015 itself to make it workable

Any updates on 2017 as 2017 will only install on Server Core 2016 but not 2015 and the 2017 is the future :)

I think @joaocgreis has started working on this, right Joao?

That's right, I'll open a PR when I have something clean.

@joaocgreis I got a minimal changeset to work. After rebasing to latest gyp we can "lie" to it by setting

  1. -Gmsvs_version=2015
  2. injecting these two parameters into the config.gypi
  "target_defaults"
      ...
      "msvs_target_platform_version" : "10.0.14393.0",
      "msbuild_toolset" : "v141",
     ...

P.S. with these I got some native modules building on just the free "Visual C++ Build Tools"

It's been over 2 months now, any update?

PRs have been opened in node (https://github.com/nodejs/node/issues/11084) and node-gyp (https://github.com/nodejs/node-gyp/issues/1101)

Also PR #1103

For reference, the minimum installation of VS2017 that works with https://github.com/nodejs/node-gyp/pull/1130 is composed of:

  • Visual Studio C++ core features
  • VC++ 2017 v141 toolset (x86,x64)
  • Windows 10 SDK (any) or Windows 8 + Universal CRT SDK

I think we can close this.

"Bring back VS150COMNTOOLS"
I urge everyone else to up vote at https://developercommunity.visualstudio.com/content/problem/35325/missing-vs150comntools.html

Hey friends,
Still can't get this Error to go away.
I have these settings in VS Enterprise 2017:
image
image
image

@Alonski if you're comfortable with pulling "pre-release" bits, the code in the master git branch`(includes https://github.com/nodejs/node-gyp/pull/1198) should solve the problem. That is SDK 10.0.15063.0 needs special parsing to detect.
Or you could try https://github.com/nodejs/node-gyp/issues/1179#issuecomment-301217151, but AFAICT once you installed 15063, the uninstall isn't clean...

@refack Do I need to rebuild Node after pulling in the pre release or just gyp?

@Alonski no need to rebuild, just pull node-gyp.
FYI

  • If you want it to work with npm i you will need to update the instance the instance that came with npm (somewhere like "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\")
  • If you only need it to work as a stand alone (like when calling >node-gyp rebuild) all you need is to git clone, and run npm i & npm link

@refack Anyway to get more direct help exactly how to do this without going back and forth here?
Inside "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\"
All I have is the node-gyp and the node-gyp.cmd files

Edit:
I wasn't looking in the right place 😅
Anyways I am still having trouble installing another package and I think it has something to do with node-gyp:

C:\WINDOWS\system32>npm i -g status-dev-cli
C:\Users\Alon\AppData\Roaming\npm\status-dev-cli -> C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\cli.js

> [email protected] install C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns
> node-gyp rebuild


C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns>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.
  dns_sd.cpp
  dns_service_browse.cpp
  dns_service_enumerate_domains.cpp
  dns_service_get_addr_info.cpp
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\dns_service_browse.cpp) [C:
\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\dns_service_enumerate_domai
ns.cpp) [C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\dns_service_get_addr_info.c
pp) [C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\dns_sd.cpp) [C:\Users\Alon\
AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
  dns_service_process_result.cpp
  dns_service_ref.cpp
  dns_service_ref_deallocate.cpp
  dns_service_ref_sock_fd.cpp
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\dns_service_ref.cpp) [C:\Us
ers\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\dns_service_process_result.
cpp) [C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\dns_service_ref_deallocate.
cpp) [C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
  dns_service_register.cpp
  dns_service_resolve.cpp
  dns_service_update_record.cpp
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\dns_service_ref_sock_fd.cpp
) [C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
  mdns_utils.cpp
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\dns_service_register.cpp) [
C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\dns_service_update_record.c
pp) [C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
  network_interface.cpp
  socket_watcher.cpp
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\dns_service_resolve.cpp) [C
:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
  txt_record_ref.cpp
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\mdns_utils.cpp) [C:\Users\A
lon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
  txt_record_create.cpp
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\network_interface.cpp) [C:\
Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\socket_watcher.cpp) [C:\Use
rs\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
  txt_record_deallocate.cpp
  txt_record_set_value.cpp
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\txt_record_ref.cpp) [C:\Use
rs\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
  txt_record_get_length.cpp
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\txt_record_create.cpp) [C:\
Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
  txt_record_buffer_to_object.cpp
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\txt_record_deallocate.cpp)
[C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\txt_record_set_value.cpp) [
C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
  win_delay_load_hook.cc
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\txt_record_get_length.cpp)
[C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
c:\users\alon\appdata\roaming\npm\node_modules\status-dev-cli\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Ca
nnot open include file: 'dns_sd.h': No such file or directory (compiling source file ..\src\txt_record_buffer_to_object
.cpp) [C:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns\build\dns_sd_bindings.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\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:258:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp 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:\Users\Alon\AppData\Roaming\npm\node_modules\status-dev-cli\node_modules\mdns
gyp ERR! node -v v6.10.3
gyp ERR! node-gyp -v v3.6.1
gyp ERR! not ok
C:\Users\Alon\AppData\Roaming\npm
`-- (empty)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "-g" "status-dev-cli"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs mdns
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls mdns
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\WINDOWS\system32\npm-debug.log
npm ERR! code 1

@Alonski so first of all it seems like you got node-gyp to work 👍
as for status-dev-cli more specifically it's dependency node-mdns. It seems like you'll need Apple's mDNSResponder as per https://github.com/agnat/node_mdns#installation

@refack Yea thanks a lot!
It is quite non intuitive that to install one package I need to debug two others 😄
Got what I wanted installed!

@Alonski we are aware that the whole "native addons" story has some non trivial prerequisites, especially on Windows. We are constantly working on making it simpler.

Thanks a lot! Will be looking out for updates

Edit:
Nevermind again...
Used this:
https://www.npmjs.com/package/windows-build-tools
In Powershell

@refack
Trying to install on my second laptop.
Getting errors again and can't figure it out maybe you can:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'i',
1 verbose cli   '-g',
1 verbose cli   'mdns' ]
2 info using [email protected]
3 info using [email protected]
4 silly install loadCurrentTree
5 silly install readGlobalPackageData
6 http fetch GET 304 https://registry.npmjs.org/mdns 555ms (from cache)
7 silly pacote tag manifest for mdns@latest fetched in 624ms
8 silly install loadIdealTree
9 silly install cloneCurrentTreeToIdealTree
10 silly install loadShrinkwrap
11 silly install loadAllDepsIntoIdealTree
12 silly resolveWithNewModule [email protected] checking installable status
13 http fetch GET 200 https://registry.npmjs.org/bindings 6ms (from cache)
14 http fetch GET 200 https://registry.npmjs.org/nan 6ms (from cache)
15 silly pacote range manifest for bindings@~1.2.1 fetched in 17ms
16 silly resolveWithNewModule [email protected] checking installable status
17 silly pacote range manifest for nan@~2.3.0 fetched in 15ms
18 silly resolveWithNewModule [email protected] checking installable status
19 silly currentTree npm
20 silly idealTree npm
20 silly idealTree `-- [email protected]
20 silly idealTree   +-- [email protected]
20 silly idealTree   `-- [email protected]
21 silly install generateActionsToTake
22 silly diffTrees action count 3
23 silly diffTrees add [email protected]
24 silly diffTrees add [email protected]
25 silly diffTrees add [email protected]
26 silly decomposeActions action count 24
27 silly decomposeActions fetch [email protected]
28 silly decomposeActions extract [email protected]
29 silly decomposeActions preinstall [email protected]
30 silly decomposeActions build [email protected]
31 silly decomposeActions install [email protected]
32 silly decomposeActions postinstall [email protected]
33 silly decomposeActions finalize [email protected]
34 silly decomposeActions refresh-package-json [email protected]
35 silly decomposeActions fetch [email protected]
36 silly decomposeActions extract [email protected]
37 silly decomposeActions preinstall [email protected]
38 silly decomposeActions build [email protected]
39 silly decomposeActions install [email protected]
40 silly decomposeActions postinstall [email protected]
41 silly decomposeActions finalize [email protected]
42 silly decomposeActions refresh-package-json [email protected]
43 silly decomposeActions fetch [email protected]
44 silly decomposeActions extract [email protected]
45 silly decomposeActions preinstall [email protected]
46 silly decomposeActions build [email protected]
47 silly decomposeActions install [email protected]
48 silly decomposeActions postinstall [email protected]
49 silly decomposeActions finalize [email protected]
50 silly decomposeActions refresh-package-json [email protected]
51 silly install executeActions
52 silly doSerial global-install 24
53 verbose correctMkdir C:\Users\Alon\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
54 verbose lock using C:\Users\Alon\AppData\Roaming\npm-cache\_locks\staging-adaed73c8d0549a8.lock for C:\Users\Alon\AppData\Roaming\npm\node_modules\.staging
55 silly doParallel extract 24
56 silly extract [email protected]
57 silly pacote trying bindings@https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz by hash: sha1-FK1hE4EtLTfXLme0ystLtyZQXxE=
58 silly extract [email protected]
59 silly pacote trying nan@https://registry.npmjs.org/nan/-/nan-2.3.5.tgz by hash: sha1-gioNwmYpDOTNOhIoLKPn42Rmigg=
60 silly extract [email protected]
61 silly pacote trying mdns@https://registry.npmjs.org/mdns/-/mdns-2.3.3.tgz by hash: sha1-u8atVAeiMBM9YuDaaS8p8L1Jco4=
62 silly pacote bindings@https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz extracted to C:\Users\Alon\AppData\Roaming\npm\node_modules\.staging\bindings-29801563 by content address 30ms
63 silly pacote nan@https://registry.npmjs.org/nan/-/nan-2.3.5.tgz extracted to C:\Users\Alon\AppData\Roaming\npm\node_modules\.staging\nan-b2463e9a by content address 124ms
64 silly pacote mdns@https://registry.npmjs.org/mdns/-/mdns-2.3.3.tgz extracted to C:\Users\Alon\AppData\Roaming\npm\node_modules\.staging\mdns-f611a65d by content address 182ms
65 silly doReverseSerial remove 24
66 silly doSerial move 24
67 silly doSerial finalize 24
68 silly finalize C:\Users\Alon\AppData\Roaming\npm\node_modules\mdns
69 silly finalize C:\Users\Alon\AppData\Roaming\npm\node_modules\mdns\node_modules\nan
70 silly finalize C:\Users\Alon\AppData\Roaming\npm\node_modules\mdns\node_modules\bindings
71 silly doParallel refresh-package-json 24
72 silly refresh-package-json C:\Users\Alon\AppData\Roaming\npm\node_modules\mdns
73 silly refresh-package-json C:\Users\Alon\AppData\Roaming\npm\node_modules\mdns\node_modules\nan
74 silly refresh-package-json C:\Users\Alon\AppData\Roaming\npm\node_modules\mdns\node_modules\bindings
75 silly doParallel preinstall 24
76 silly preinstall [email protected]
77 info lifecycle [email protected]~preinstall: [email protected]
78 silly preinstall [email protected]
79 info lifecycle [email protected]~preinstall: [email protected]
80 silly preinstall [email protected]
81 info lifecycle [email protected]~preinstall: [email protected]
82 silly lifecycle [email protected]~preinstall: no script for preinstall, continuing
83 silly lifecycle [email protected]~preinstall: no script for preinstall, continuing
84 silly lifecycle [email protected]~preinstall: no script for preinstall, continuing
85 silly doSerial build 24
86 silly build [email protected]
87 info linkStuff [email protected]
88 silly linkStuff [email protected] has C:\Users\Alon\AppData\Roaming\npm\node_modules as its parent node_modules
89 silly linkStuff [email protected] is part of a global install
90 silly linkStuff [email protected] is installed into a global node_modules
91 silly linkStuff [email protected] is installed into the top-level global node_modules
92 verbose linkBins [email protected]
93 verbose linkMans [email protected]
94 silly build [email protected]
95 info linkStuff [email protected]
96 silly linkStuff [email protected] has C:\Users\Alon\AppData\Roaming\npm\node_modules\mdns\node_modules as its parent node_modules
97 silly linkStuff [email protected] is part of a global install
98 silly linkStuff [email protected] is installed into a global node_modules
99 verbose linkBins [email protected]
100 verbose linkMans [email protected]
101 silly build [email protected]
102 info linkStuff [email protected]
103 silly linkStuff [email protected] has C:\Users\Alon\AppData\Roaming\npm\node_modules\mdns\node_modules as its parent node_modules
104 silly linkStuff [email protected] is part of a global install
105 silly linkStuff [email protected] is installed into a global node_modules
106 verbose linkBins [email protected]
107 verbose linkMans [email protected]
108 silly doSerial global-link 24
109 silly doParallel update-linked 24
110 silly doSerial install 24
111 silly install [email protected]
112 info lifecycle [email protected]~install: [email protected]
113 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle true
114 verbose lifecycle [email protected]~install: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\Alon\AppData\Roaming\npm\node_modules\mdns\node_modules\.bin;C:\Users\Alon\AppData\Roaming\npm\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\PuTTY\;C:\Program Files\dotnet\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Users\Alon\AppData\Local\Android\android-sdk;C:\Users\Alon\AppData\Local\Android\android-sdk\tools;C:\Users\Alon\AppData\Local\Android\android-sdk\platform-tools;C:\Program Files (x86)\Yarn\bin;C:\Program Files\Docker Toolbox;C:\OpenSSL;C:\Program Files (x86)\HyperG;C:\Program Files\Geth;C:\Program Files\Docker Toolbox;C:\OpenSSL;C:\Program Files (x86)\HyperG;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\nodejs\;C:\Program Files\Bonjour SDK\;C:\Users\Alon\AppData\Local\Programs\Python\Python35-32\Scripts\;C:\Users\Alon\AppData\Local\Programs\Python\Python35-32\;C:\Users\Alon\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Windows\system32\node_modules\.bin;C:\Program Files (x86)\Microsoft VS Code Insiders\bin;C:\Users\Alon\AppData\Local\Yarn\bin;C:\Users\Alon\AppData\Roaming\npm
115 verbose lifecycle [email protected]~install: CWD: C:\Users\Alon\AppData\Roaming\npm\node_modules\mdns
116 silly lifecycle [email protected]~install: Args: [ '/d /s /c', 'node-gyp rebuild' ]
117 silly lifecycle [email protected]~install: Returned: code: 1  signal: null
118 info lifecycle [email protected]~install: Failed to exec install script
119 verbose unlock done using C:\Users\Alon\AppData\Roaming\npm-cache\_locks\staging-adaed73c8d0549a8.lock for C:\Users\Alon\AppData\Roaming\npm\node_modules\.staging
120 verbose stack Error: [email protected] install: `node-gyp rebuild`
120 verbose stack Exit status 1
120 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:283:16)
120 verbose stack     at emitTwo (events.js:125:13)
120 verbose stack     at EventEmitter.emit (events.js:213:7)
120 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
120 verbose stack     at emitTwo (events.js:125:13)
120 verbose stack     at ChildProcess.emit (events.js:213:7)
120 verbose stack     at maybeClose (internal/child_process.js:887:16)
120 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
121 verbose pkgid [email protected]
122 verbose cwd C:\Windows\system32
123 verbose Windows_NT 10.0.14393
124 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "-g" "mdns"
125 verbose node v8.0.0
126 verbose npm  v5.0.0
127 error code ELIFECYCLE
128 error errno 1
129 error [email protected] install: `node-gyp rebuild`
129 error Exit status 1
130 error Failed at the [email protected] install script.
130 error This is probably not a problem with npm. There is likely additional logging output above.
131 verbose exit [ 1, true ]

@Alonski so you were just missing the buildtools, and this is the error you got?
IMHO that's a new issue: "Windows: npm@5 and no build tools installed, gives a non informative error message"

@refack Thing is with npm 3 I wasn't able to use npm i -g windows-build-tools kept erroring out and I had to install everything by hand.

@refack When would the latest node-gyp would be shipped with default Node.js?

would be shipped with default Node.js?

Do you mean Node 6?

@gibfahn 8.

The latest release of node-gyp is 3.6.1, the version in Node 8.0.0 is also 3.6.1.

There are a couple of commits on node-gyp master since 3.6.1, they won't go into node until node-gyp does another release, that release is PR'd into npm5, and the updated npm version is PR'd into node.

We need a new 3.6.2 to solve @Alonski 's problem (building with sdk 10.0.15063)

Will be in [email protected]
Ref: npm/npm#16894

Hello! I am alittle confused about the status of node-gyp and VS2017 right now. Should it work? I could not get it to work right away, but the prerequisites of the VS installation leave a lot of space for errors (like accidentially installing Python 3!). I am trying out different angles and would love to write a follow up wiki page if there is a way to get it to work.
Thanks for your time.

Hello @Xan-Kun, [email protected] should work even with with newer releases of VS2017 (including SDK 10.0.15063).
Since most people use node-gyp vicariously through npm i this fix will only be available in [email protected], but that should be released soon.
If you do write a wiki, also consider submitting a PR for our README.md since that is our reference document.

Hello @refack and thank you so much for your answer. Actually, I try to get noble running with nw.js and every time I try (for 3 days now :-) ) I get stuck at another point (last thing were errors about a timespec struct). Without nw.js-hassle, node-gyp works seemlessly in VS2017 for me. I can install noble directly from the built in npm interface, it compiles the components and connects to the device.
But so far no luck :-/

@Xan-Kun good luck 👍 I have just a little bit of nw.js experience, so I can't give good advice. Although I know it's not super mature and there are allot of unsolved edge-cases, so you're not alone (Maybe try Electron everybody is super happy with it... 🤷‍♂️ )

I tried electron too, got quite far, but ultimately, something didn't work, depending on which versions and combinations I used. With nw.js it is of course even harder, but I wanted to have direct access to node from within the webpage. That was a very dear feature for me. I couldn't get it to work after many tries (and even worse, it's one of these "i don't have a clue why it doesn't work-scenarios"). I will report if I ever get there.

Hello,
Still in 2017, Visual Studio 2015 Express is findable on Microsoft sites: https://www.visualstudio.com/fr/post-download-vs/?sku=xdesk&clcid=0x409&telem=ga

Add the VCBuild.exe to the path and DEV environement is fixed, however deprecated.

I guess this won't be the case for long with their new politic but it's a substitute for projects with old NodeJS stack versioning. I have quite a few in my scope whose migrating NodeJS dev stack has never been the priority against other things. NodeJS is such a mess because he evolved way too fast and yet, now they are forking to Ayo.js.

As an architect, regarding the past years and how thoses NodeJS dependencies turned out is pretty laughable. So much heavy coupling, way too fast and too many evolutions.

node-gyp still uses msvs 2015 with installed 2017 version

https://github.com/nodejs/node-gyp/issues/1278

Is there any fix?

I resolved this issue by doing the following..

  1. Open node-gyp folder (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyp)
  2. Navigate to 'gyppylibgyp'
  3. Open (for editing) MSVersion.py
  4. Search for 'v140' (line 237 in my case) default_toolset='v140'
  5. Change to 'v141' and save default_toolset='v141'
  6. This should change build tools location for VS 2015 to target the VS2017 tools installed, as shown below..
    versions = { '2015': VisualStudioVersion('2015', 'Visual Studio 2015', solution_version='12.00', project_version='14.0', flat_sln=False, uses_vcxproj=True, path=path, sdk_based=sdk_based, default_toolset='v141')

I also performed the above steps within the node_modules folder of the application (although I do not believe this was necessary).

Hopefully that helps someone else.

Unbelievable that this is still an issue.

I can't believe I'm wasting my time trying to find dependency to write JavaScript code seriously just because they can't support Visual Studio 2017.

@wfoster232 I'm running VS2017 and I fixed it by installing the VC2015.3 toolset for desktop, so I didn't have to manually edit any files

@TooTallNate @bnoordhuis @isaacs can you please fix this? This is ridiculous. I'd imagine thousands upon thousands of developer hours have been completely wasted trying to debug this issue, and it still doesn't work.

https://github.com/tensorflow/tfjs/issues/739

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lopezdp picture lopezdp  ·  3Comments

halkar picture halkar  ·  4Comments

jplatte picture jplatte  ·  3Comments

chen4393 picture chen4393  ·  3Comments

alexeyvo picture alexeyvo  ·  3Comments