nodejs / node-gyp

Node.js native addon build tool
MIT License
9.91k stars 1.79k forks source link

Visual Studio 2017 #1056

Closed felixfbecker closed 7 years ago

felixfbecker commented 7 years ago

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?

refack commented 7 years ago

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

refack commented 7 years ago

Will be in npm@5.0.2 Ref: npm/npm#16894

Xan-Kun commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

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 commented 6 years ago

node-gyp still uses msvs 2015 with installed 2017 version

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

Is there any fix?

willfsays commented 6 years ago

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 commented 5 years ago

Unbelievable that this is still an issue.

msuiche commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

@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