Skip to content

node-gyp is unable to find msbuild if VS2019 is installed.  #1663

Closed
@chrispat

Description

@chrispat
  • Node Version: node 10.15.1 npm 6.4.1
  • Platform: Windows Server 2019
  • Compiler: msbuild 15.9.21+g9802d43bc3
Verbose output (from npm or node-gyp):
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: D:\a\1\jest\node_modules\weak
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp http GET https://nodejs.org/download/release/v10.15.1/node-v10.15.1-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v10.15.1/node-v10.15.1-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v10.15.1/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v10.15.1/win-x86/node.lib
gyp http GET https://nodejs.org/download/release/v10.15.1/win-x64/node.lib
gyp http 200 https://nodejs.org/download/release/v10.15.1/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v10.15.1/win-x86/node.lib
gyp http 200 https://nodejs.org/download/release/v10.15.1/win-x64/node.lib
gyp info spawn C:\ProgramData\Chocolatey\bin\python2.EXE
gyp info spawn args [ 'D:\\a\\1\\jest\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\a\\1\\jest\\node_modules\\weak\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\a\\1\\jest\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\VssAdministrator\\.node-gyp\\10.15.1\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\VssAdministrator\\.node-gyp\\10.15.1',
gyp info spawn args   '-Dnode_gyp_dir=D:\\a\\1\\jest\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\VssAdministrator\\.node-gyp\\10.15.1\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=D:\\a\\1\\jest\\node_modules\\weak',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'D:\\a\\1\\jest\\node_modules\\weak\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]

I have also tried to install VS2017 build tools on the machine in addition to VS 2019 and node-gyp still tries to find msbuild under the VS2019 install. The issue is due to VS2019 having a different location for msbuild form VS2017. It puts it under C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin instead of C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\15.0\Bin

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions