在Ubuntu上构建vscode时找不到包'xkbfile'

时间:2019-04-27 08:05:31

标签: ubuntu visual-studio-code

我正在从Ubuntu 18.04.2 LTS上的源代码构建VS代码。 运行时

yarn run watch

按照https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run的指示进行操作,并出现以下错误。

Error: Cannot find module 'gulp-watch'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/title/workspace/vscode/build/lib/watch/index.js:23:68)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
error Command failed with exit code 1.

因此,我尝试通过执行yarn add gulp-watch --no-save来安装gulp-watch并出现以下错误

error /home/title/workspace/vscode/node_modules/native-keymap: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/title/workspace/vscode/node_modules/native-keymap
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.10.0 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/share/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/title/workspace/vscode/node_modules/native-keymap/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/share/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/title/.node-gyp/iojs-3.1.8/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/title/.node-gyp/iojs-3.1.8',
gyp info spawn args   '-Dnode_gyp_dir=/usr/share/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/title/.node-gyp/iojs-3.1.8/<(target_arch)/iojs.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/title/workspace/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   'build',
gyp info spawn args   '-Goutput_dir=.' ]
Package xkbfile was not found in the pkg-config search path.
Perhaps you should add the directory containing `xkbfile.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xkbfile' found
gyp: Call to 'pkg-config x11 xkbfile --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:340:16)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-47-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/title/workspace/vscode/node_modules/native-keymap

让我感兴趣的是No package 'xkbfile' found消息,但没有发现与xkbfile相关的消息。

我该如何克服?

谢谢

1 个答案:

答案 0 :(得分:0)

根据https://github.com/Microsoft/node-native-keymap。 我必须通过执行来安装node-native-keymap的依赖项

https://github.com/Microsoft/node-native-keymap