如何解决 jupyterlab-vim 的安装错误

How to resolve installation error for jupyterlab-vim

我正在尝试安装 jupyterlab-vim,jupyter-lab 的 vim 扩展。有没有人根据这条简短的错误消息知道该怎么做?

我试过更新 npm @phosphor/domutils 包。 npm info @phosphor/domutils显示我有1.1.3版本,好像是必须的依赖,看package.json。仍然没有运气。

jupyter-lab 版本为 1.1.0a1。

安装脚本是

jupyter labextension install jupyterlab_vim
An error occured.
KeyError: '@phosphor/domutils'
See the log file for details:  /var/folders/lr/y3b61w391ldgpfc53_x3y9x00000gp/T/jupyterlab-debug-2l4e0j6s.log

日志文件的内容如下。

Node v11.14.0

> /usr/local/bin/npm pack jupyterlab_vim
npm notice 
npm notice   jupyterlab_vim@0.11.0
npm notice === Tarball Contents === 
npm notice 1.3kB  package.json   
npm notice 1.5kB  History.md     
npm notice 1.1kB  LICENSE        
npm notice 4.8kB  README.md      
npm notice 274B   lib/index.d.ts 
npm notice 21.4kB lib/index.js   
npm notice 0      style/index.css
npm notice === Tarball Details === 
npm notice name:          jupyterlab_vim                          
npm notice version:       0.11.0                                  
npm notice filename:      jupyterlab_vim-0.11.0.tgz               
npm notice package size:  6.8 kB                                  
npm notice unpacked size: 30.2 kB                                 
npm notice shasum:        e9339dde205c631a168b2291856257d7ed7dd54b
npm notice integrity:     sha512-KXIZos4FJ/PCk[...]OUx6XN4ox0tTQ==
npm notice total files:   7                                       
npm notice 
jupyterlab_vim-0.11.0.tgz

Traceback (most recent call last):

  File "~/.pyenv/versions/3.7.0/envs/env_name/lib/python3.7/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

  File "~/.pyenv/versions/3.7.0/envs/env_name/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 87, in start
    ans = self.run_task()

  File "~/.pyenv/versions/3.7.0/envs/env_name/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 115, in run_task
    for arg in self.extra_args

  File "~/.pyenv/versions/3.7.0/envs/env_name/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 115, in <listcomp>
    for arg in self.extra_args

  File "~/.pyenv/versions/3.7.0/envs/env_name/lib/python3.7/site-packages/jupyterlab/commands.py", line 316, in install_extension
    return handler.install_extension(extension)

  File "~/.pyenv/versions/3.7.0/envs/env_name/lib/python3.7/site-packages/jupyterlab/commands.py", line 517, in install_extension
    info = self._install_extension(extension, tempdir)

  File "~/.pyenv/versions/3.7.0/envs/env_name/lib/python3.7/site-packages/jupyterlab/commands.py", line 1395, in _install_extension
    errors = _validate_compatibility(extension, deps, core_data)

  File "~/.pyenv/versions/3.7.0/envs/env_name/lib/python3.7/site-packages/jupyterlab/commands.py", line 1759, in _validate_compatibility
    overlap = _test_overlap(core_deps[key], value)

KeyError: '@phosphor/domutils'

Exiting application: jupyter


众所周知,将 jupyterlab 降级到 1.0.0 解决了该错误。