Node-gyp: npm config set msvs_version 2015 not working with VS15 alpha2

Created on 24 May 2016  路  11Comments  路  Source: nodejs/node-gyp

even after npm config set msvs_version 2015
npm install - triggered node-gyp build module with MSBuild 15.0 when Visual Studio 15 preview2 is installed

Is it so difficult to make MSBuild 15.0 works with node-gyp?

Most helpful comment

@alanpurple if node-gyp cannot find MSBuild.exe on the %PATH% it looks into the registry and then takes the latest version found there, thus it's shelling out to VS15 Alpha/Preview instead of VS 2015.

Doing

SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%

before calling npm install should solve this.

All 11 comments

Upstream gyp doesn't support VS 15 yet so neither does node-gyp.

@bnoordhuis What I mean is even if I installed MSVS2015 or VC++Builder, same thing happens if I also installed MSVS15

Ah, that I don't know. It sounds like VS 15 does something (clobber the environment? the registry?) that confuses gyp.

Just to be sure, does npm install --msvs_version=2015 work?

@bnoordhuis nope, same

Error: C:\Program Files (x86)\MSBuild\15.0\bin\msbuild.exe failed with exit code: 1

@alanpurple if node-gyp cannot find MSBuild.exe on the %PATH% it looks into the registry and then takes the latest version found there, thus it's shelling out to VS15 Alpha/Preview instead of VS 2015.

Doing

SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%

before calling npm install should solve this.

Old issue, but VS15 would be --msvs_version=2017

Old issue, but VS15 would be --msvs_version=2017

We did not upgrade to the latest version of GYP, and the current version does not know what 2017 is. For now we're lying to it that it's 2015 with v141 toolset.
Ref: https://github.com/nodejs/node-gyp/blob/master/lib/configure.js#L156

Anyway I'm closing this issue, since we do auto detect VS15 a.k.a. VS2017 since [email protected]

npm -v = 6.14
node -v = 10.15.3
os = windows 7 sp1

npm i -g --production windows-build-tools

npm install --global --production [email protected]

still gettting error, could

D:\gulaqWorkspace\api\node_modules\iconv>if not defined npm_config_node_gyp (nod
e "C:\Users\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycl
e\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (no
de "C:\Users\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bi
n\node-gyp.js" rebuild )
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2015
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS valid versions for msvs_version:

@cclauss what i have to do now? i need to upgrade ? But i have using windows-7 service pack 1

Yes. It is time to upgrade. The operating system that you are running on is no longer supported. It is not right to ask others to support that for free.

Was this page helpful?
0 / 5 - 0 ratings