The `msvs_version` option doesn't work from `.npmrc` nor from environment variable
I'm using the latest node-gyp.
I've found that msvs_version doesn't actually work from .npmrc nor from environment variables.
Here's what happens.
- If you set
$env:npm_config_msvs_version=2019; node-gyp configure, what happens is that thegyp.optscontainsmsvs-version, but notmsvs_version. This leads the configure command to assume that the env variable hasn't been set. - If you set
npm config set msvs_version 2019 --location project, it also doesn't work, instead nothing is read at all, thegyp.optsdoes not containmsvs_versionat all. - If you set
node-gyp configure --msvs_version=2019then it does work, and it shows up ongyp.opts.
https://github.com/nodejs/node-gyp/pull/2644
This issue has been stale for a long time. If there are no objections, I will close this issue next Mon-Tue. In case something similar happens again please open a new issue.
In addition, https://github.com/nodejs/node-gyp/pull/2644 addresses it.
Modern versions of npm no longer allow the setting of msvs_version
So what does that mean if it is no longer allowed to set it? Is it now automatic?
https://github.com/nodejs/node-gyp/blob/main/README.md#on-windows