制作Theia扩展报错

[4/4] Building fresh packages...
[8/10] ⠠ electron
[-/10] ⠠ waiting...
[6/10] ⠠ oniguruma
[9/10] ⠠ native-keymap
error /home/theia/theia-hello-world-extension/node_modules/native-keymap: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/theia/theia-hello-world-extension/node_modules/native-keymap
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@6.0.1
gyp info using node@10.18.0 | linux | x64
gyp info find Python using Python version 3.6.8 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [ '/home/theia/theia-hello-world-extension/node_modules/electron-rebuild/node_modules/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/theia/theia-hello-world-extension/node_modules/native-keymap/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/theia/theia-hello-world-extension/node_modules/electron-rebuild/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/theia/.cache/node-gyp/10.18.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/theia/.cache/node-gyp/10.18.0',
gyp info spawn args   '-Dnode_gyp_dir=/home/theia/theia-hello-world-extension/node_modules/electron-rebuild/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/theia/.cache/node-gyp/10.18.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/theia/theia-hello-world-extension/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 x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
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 --cflags | sed s/-I//g' returned exit status 0 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 (/home/theia/theia-hello-world-extension/node_modules/electron-rebuild/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 3.10.0-693.el7.x86_64
gyp ERR! command "/home/theia/.nvm/versions/node/v10.18.0/bin/node" "/home/theia/theia-hello-world-extension/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /home/theia/theia-hello-world-extension/node_modules/native-keymap

native-keymap缺少依赖项
  • On Debian-based Linux: sudo apt-get install libx11-dev libxkbfile-dev
  • On Red Hat-based Linux: sudo yum install libx11-devel.x86_64 libxkbfile-devel.x86_64 # or .i686
  • On FreeBSD: sudo pkg install libX11
[4/4] Building fresh packages...
[8/10] ⠐ electron
[-/10] ⠐ waiting...
[-/10] ⠈ waiting...
[-/10] ⠈ waiting...
error /home/theia/theia-hello-world-extension/node_modules/electron: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /home/theia/theia-hello-world-extension/node_modules/electron
Output:
Downloading tmp-227060-0-electron-v4.2.12-linux-x64.zip
Error: read ECONNRESET
/home/theia/theia-hello-world-extension/node_modules/electron/install.js:49
  throw err
  ^

可以先在这里下载安装包:https://npm.taobao.org/mirrors/electron/

然后,将安装包(.zip文件)拷贝到以下路径:

Linux:$XDG_CACHE_HOME或~/.cache/electron/

Mac:~/Library/Caches/electron/

Windows:$LOCALAPPDATA/electron/Cache~/AppData/Local/electron/Cache/

 
posted @ 2019-12-26 14:07  HaibaraAi0913  阅读(680)  评论(0编辑  收藏  举报