microsoft / node-native-keymap

Provide OS keyboard layout functionality as a nodejs module
MIT License
136 stars 37 forks source link

Cannot build on Windows #14

Closed sryze closed 5 years ago

sryze commented 5 years ago

I'm trying to build VS Code from source code, and every time I install the dependencies via yarn it always fails at building native-keymap:

error C:\Users\user\Sources\vscode\node_modules\native-keymap: Command failed.
Exit code: 7
Command: node-gyp rebuild
Arguments:
Directory: C:\Users\user\Sources\vscode\node_modules\native-keymap
Output:
C:\Users\user\Sources\vscode\node_modules\native-keymap>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gy

p-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.11.1 | win32 | x64
gyp http GET https://atom.io/download/electron/v4.2.10/node-v4.2.10-headers.tar.gz
gyp http 200 https://atom.io/download/electron/v4.2.10/node-v4.2.10-headers.tar.gz
gyp http GET https://atom.io/download/electron/v4.2.10/SHASUMS256.txt
gyp http GET https://atom.io/download/electron/v4.2.10/win-x86/node.lib
gyp http GET https://atom.io/download/electron/v4.2.10/win-x64/node.lib
gyp http 200 https://atom.io/download/electron/v4.2.10/win-x64/node.lib
gyp http 200 https://atom.io/download/electron/v4.2.10/win-x86/node.lib
gyp http 200 https://atom.io/download/electron/v4.2.10/SHASUMS256.txt
gyp info spawn C:\Python27\python.EXE
gyp info spawn args [ 'C:\\Program Files\\nodejs\\node_modules\\npm\\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   'C:\\Users\\user\\Sources\\vscode\\node_modules\\native-keymap\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\user\\.node-gyp\\4.2.10\\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\\user\\.node-gyp\\4.2.10',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\user\\.node-gyp\\4.2.10\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\user\\Sources\\vscode\\node_modules\\native-keymap',
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   'C:\\Users\\user\\Sources\\vscode\\node_modules\\native-keymap\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\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' ]
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT
gyp ERR! stack     at _errnoException (util.js:1022:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
gyp ERR! stack     at onErrorNT (internal/child_process.js:372:16)
gyp ERR! stack     at _combinedTickCallback (internal/process/next_tick.js:138:11)
gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:180:9)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebu

ild"
gyp ERR! cwd C:\Users\user\Sources\vscode\node_modules\native-keymap
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2

I have both Visual Studio 2017 and 2019 installed, and also the C++ compilers and build tools (including MSBuild).

sryze commented 5 years ago

This helped in my case:

yarn config set msvs_version 2017 --global