Jupyter-Lab plotly扩展-RuntimeError:npm依赖项无法安装

时间:2020-06-17 09:34:26

标签: node.js npm plotly jupyter-lab

我一直在尝试使用以下方法为Plotly安装Jupyter-Lab渲染器支持:

(base) C:\>jupyter labextension install jupyterlab-plotly

错误消息:

Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: npm dependencies failed to install
See the log file for details:  C:\Users\<user>\AppData\Local\Temp\jupyterlab-debug-kyq0fo9a.log

如果我尝试使用--no-build命令安装扩展程序,则在尝试运行jupyter lab build时会遇到相同的错误

我还尝试通过conda install nodejs并通过浏览器安装来安装node.js。两者都以相同的结果结束

规格:

  • Windows 10
  • Python 3.7.6
  • Nodejs 10.13.0
  • Jupyter-Lab 2.1.4
  • 密谋4.8.1

日志文件:

Node v10.13.0

Yarn configuration loaded.
> C:\Users\<user>\Miniconda3\npm.CMD pack jupyterlab-plotly@4.8.1
npm notice 
npm notice package: jupyterlab-plotly@4.8.1
npm notice === Tarball Contents === 
npm notice 1.0kB package.json                         
npm notice 156B  README.md                            
npm notice 6.3kB dist/javascript-renderer-extension.js
npm notice 545B  style/index.css                      
npm notice 1.0kB style/plotly.svg                     
npm notice === Tarball Details === 
npm notice name:          jupyterlab-plotly                       
npm notice version:       4.8.1                                   
npm notice filename:      jupyterlab-plotly-4.8.1.tgz             
npm notice package size:  3.1 kB                                  
npm notice unpacked size: 9.1 kB                                  
npm notice shasum:        a91e11dd8ffa94c361dee38de57fb8cf11e44438
npm notice integrity:     sha512-YnIzfxnC313MY[...]TiZy2L2mgzIJA==
npm notice total files:   5                                       
npm notice 
jupyterlab-plotly-4.8.1.tgz

Node v10.13.0

Yarn configuration loaded.
Building jupyterlab assets (build:prod:minimize)
> node C:\Users\<user>\Miniconda3\lib\site-packages\jupyterlab\staging\yarn.js install --non-interactive
yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
error Couldn't find package "plotly.js@^1.54.1" required by "jupyterlab-plotly@file:../extensions/jupyterlab-plotly-4.8.1.tgz" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Couldn't find package "@types/plotly.js@1.44.28" required by "jupyterlab-plotly@file:../extensions/jupyterlab-plotly-4.8.1.tgz" on the "npm" registry.
    at C:\Users\<user>\Miniconda3\share\jupyter\lab\staging\yarn.js:38113:17
    at Generator.throw (<anonymous>)
    at step (C:\Users\<user>\Miniconda3\share\jupyter\lab\staging\yarn.js:310:30)
    at C:\Users\<user>\Miniconda3\share\jupyter\lab\staging\yarn.js:323:13
    at process._tickCallback (internal/process/next_tick.js:68:7)

npm dependencies failed to install
Traceback (most recent call last):

  File "C:\Users\<user>\Miniconda3\lib\site-packages\jupyterlab\debuglog.py", line 47, in debug_logging
    yield

  File "C:\Users\<user>\Miniconda3\lib\site-packages\jupyterlab\labextensions.py", line 105, in start
    command=command, app_options=app_options)

  File "C:\Users\<user>\Miniconda3\lib\site-packages\jupyterlab\commands.py", line 460, in build
    command=command, clean_staging=clean_staging)

  File "C:\Users\<user>\Miniconda3\lib\site-packages\jupyterlab\commands.py", line 652, in build
    raise RuntimeError(msg)

RuntimeError: npm dependencies failed to install

Exiting application: jupyter

1 个答案:

答案 0 :(得分:0)

这可能是由于防火墙和任何最终陷阱所致。尝试暂时禁用这些功能,看看是否能够安装。