nodejs / node-gyp

Node.js native addon build tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

msvs_version option seems ineffectual in selecting correct msbuild.exe

Ananym opened this issue · comments

I have both visual studio community 2022 installed and the 2019 build tools installed. For a particular project, I want to use the msbuild.exe from the latter.

When I call e.g. node-gyp configure, I pass in --msvs_version=2019.
I also have npm_config_msvs_version set to 2019 as an env var.
I also have an MSBUILD_PATH env var set to the 2019 msbuild executable.
I have the VS Setup powershell module installed.
I'm always configuring from clean.
I also have msvs_version=2019 set in my npm config file.

Regardless, node-gyp will always try to use the msbuild from visual studio 2022.
What else can I try?

Hello @Ananym, can you please share the logs you get when running node-gyp (eg. node-gyp configure)? Feel free to add --loglevel silly to gather as much info as possible. I appreciate any help you can provide.

Looks like this is v9 specific - can't reproduce in v10. However, @electron/rebuild is set to use v9 - still trying to coax it to use v10, but it seems like anything I try to push through electron rebuild with v10 hangs forever.
Here's the v9 configure output, but completely understand if v9 changes aren't really on the radar.
node-gyp configure.log

Oh. Ignore those logs. Silly typo in the argument... Guess I still need to work through some of this.

Thanks for the update. Closing the issue. Reopen or open a new one if you encounter any problems.