Skip to content

Visual Studio 2017 #1056

Closed
Closed
@felixfbecker

Description

@felixfbecker

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?

Activity

rvagg

rvagg commented on Nov 23, 2016

@rvagg
Member

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?

felixfbecker

felixfbecker commented on Nov 23, 2016

@felixfbecker
Author

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 lodash-node@2.4.1: This package is discontinued. Use lodash@^4.0.0.

> lwip@0.0.9 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.

rvagg

rvagg commented on Nov 23, 2016

@rvagg
Member

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

joshgav

joshgav commented on Nov 23, 2016

@joshgav
felixrieseberg

felixrieseberg commented on Nov 23, 2016

@felixrieseberg
Member

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.

felixfbecker

felixfbecker commented on Nov 23, 2016

@felixfbecker
Author

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

Fishrock123

Fishrock123 commented on Dec 5, 2016

@Fishrock123
Contributor

@felixrieseberg Status update?

felixfbecker

felixfbecker commented on Dec 5, 2016

@felixfbecker
Author

Is there an issue open at gyp about this?

mousetraps

mousetraps commented on Dec 5, 2016

@mousetraps
Contributor

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.

joshgav

joshgav commented on Dec 5, 2016

@joshgav

@mousetraps good to see you :)

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

mousetraps

mousetraps commented on Dec 5, 2016

@mousetraps
Contributor

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.

kunalspathak

kunalspathak commented on Dec 5, 2016

@kunalspathak
Member

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

seishun

seishun commented on Dec 5, 2016

@seishun

Is VS2017 even supported by V8?

bnoordhuis

bnoordhuis commented on Dec 5, 2016

@bnoordhuis
Member

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

amigo421

amigo421 commented on Dec 7, 2016

@amigo421

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.

44 remaining items

Xan-Kun

Xan-Kun commented on Jun 3, 2017

@Xan-Kun

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.

refack

refack commented on Jun 3, 2017

@refack
Contributor

Hello @Xan-Kun, node-gyp@3.6.2 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 npm@5.02, 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.

Xan-Kun

Xan-Kun commented on Jun 4, 2017

@Xan-Kun

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 :-/

refack

refack commented on Jun 4, 2017

@refack
Contributor

@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... 🤷‍♂️ )

Xan-Kun

Xan-Kun commented on Jun 4, 2017

@Xan-Kun

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.

afages

afages commented on Sep 5, 2017

@afages

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.

jsmonkey

jsmonkey commented on Feb 7, 2018

@jsmonkey

node-gyp still uses msvs 2015 with installed 2017 version

#1278

Is there any fix?

willfsays

willfsays commented on Oct 4, 2018

@willfsays

I resolved this issue by doing the following..

  1. Open node-gyp folder (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp)
  2. Navigate to '\gyp\pylib\gyp'
  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.

msuiche

msuiche commented on Dec 16, 2018

@msuiche

Unbelievable that this is still an issue.

msuiche

msuiche commented on Dec 16, 2018

@msuiche

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.

TheBeardedLlama

TheBeardedLlama commented on Jan 29, 2019

@TheBeardedLlama

@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

ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @refack@joaocgreis@digitalinfinity@be5invis@bnoordhuis

      Issue actions

        Visual Studio 2017 · Issue #1056 · nodejs/node-gyp