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

标签 ubuntu visual-studio-code

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

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 相关的太多内容。

我如何通过这个?

谢谢

最佳答案

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

sudo apt-get install -y g++ gcc make python2.7 pkg-config libx11-dev libxkbfile-dev libsecret-1-dev

关于ubuntu - 在 Ubuntu 上构建 vscode 时找不到包 'xkbfile',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55878536/

相关文章:

visual-studio-code - 代码。不被识别为内部或外部命令

python - VSCode 中的失控绝地语言任务

visual-studio-code - 防止 VS Code 多行注释中的尾随和前导空格

java - Visual Studio Code - Cucumber - 无法找到具有特殊字符的步骤

linux - 无法为 Imageick 执行 GS 脚本

node.js - JSDoc 对象定义中的多行

linux - 缺少 ch 命令 ubuntu

gcc - 将 newlib 移植到交叉编译器中

windows - 在 Linux 中使用 jenkins 和 electron-packager 为 windows 打包 Electron 应用程序

php - 在 Linux 上安装 GD 库和 freetype