jupyterlab-plotly构建npm扩展无法在Linux上安装 [英] jupyterlab-plotly build npm extensions failed to install on Linux

查看:177
本文介绍了jupyterlab-plotly构建npm扩展无法在Linux上安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是为了帮助那些面临类似问题的人.尝试安装jupyterlab-plotly扩展程序时,我的构建失败.我的Jupyter Lab版本是1.2.6版.日志如下:

This is to help those who face a similar issue. My builds were failing when trying to install the jupyterlab-plotly extension. My Jupyter Lab version is Version 1.2.6. The log was as follows:

[LabBuildApp] Building in /home/***/anaconda3/share/jupyter/lab
[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Node v6.13.1

[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
[LabBuildApp] > node /home/***/anaconda3/lib/python3.7/site-packages/jupyterlab/staging/yarn.js install --non-interactive
[LabBuildApp] yarn install v1.15.2
[1/5] Validating package.json...
[2/5] Resolving packages...
warning jupyterlab-plotly > plotly.js > regl-splom > left-pad@1.3.0: use String.prototype.padStart()
warning jupyterlab-plotly > plotly.js > point-cluster > bubleify > buble > os-homedir@2.0.0: This is not needed anymore. Use `require('os').homedir()` instead.
[3/5] Fetching packages...
error ws@7.2.1: The engine "node" is incompatible with this module. Expected version ">=8.3.0". Got "6.13.1"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

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

[LabBuildApp]   File "/home/***/anaconda3/lib/python3.7/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

[LabBuildApp]   File "/home/***/anaconda3/lib/python3.7/site-packages/jupyterlab/labapp.py", line 98, in start
    command=command, app_options=app_options)

[LabBuildApp]   File "/home/***/anaconda3/lib/python3.7/site-packages/jupyterlab/commands.py", line 459, in build
    command=command, clean_staging=clean_staging)

[LabBuildApp]   File "/home/***/anaconda3/lib/python3.7/site-packages/jupyterlab/commands.py", line 660, in build
    raise RuntimeError(msg)

[LabBuildApp] RuntimeError: npm dependencies failed to install

[LabBuildApp] Exiting application: JupyterLab
~                                                                                                                                                     
~                                                                                                                                                     
"/tmp/jupyterlab-debug-7x6sz5zm.log" 34L, 1758C

解决方案在答案中

推荐答案

如日志文件所示,问题似乎是我的anaconda环境中的node已过时.

The issue, as indicated by the log file, seemed to be that the node in my anaconda environment was outdated.

$ type node
node is hashed (/home/***/anaconda3/bin/node)

$ node --version
v6.13.1

查看我机器上的nodejs:

Looking at the nodejs on my machine:

$ type nodejs
nodejs is hashed (/usr/bin/nodejs)

$ nodejs --version
v10.15.2

要解决此问题,我做了以下事情:

To get around this issue I did the following:

  1. 导航到node的父目录
  2. 以防万一,备份了node
  3. nodejs进行符号链接,在此将其命名为节点"
  4. 运行版本
  5. 启用了jupyterlab-plotly扩展名
  6. 重新启动Jupyter Lab服务器
  1. Navigated to node's parent directory
  2. Made a backup of node just in case
  3. Made a symlink to nodejs here named as "node"
  4. Ran the build
  5. Enabled the jupyterlab-plotly extension
  6. Restarted the Jupyter Lab server

命令如下:

cd /home/***/anaconda3/bin/
cp node node_bak
rm node
sudo ln -s /usr/bin/nodejs /home/***/anaconda3/bin/node
jupyter lab clean
jupyter lab build

一段时间后,构建成功结束.

After some time, the build concluded successfully.

我从内置扩展管理器中启用了jupyterlab-plotly扩展.然后我重新启动了服务器.

I enabled the jupyterlab-plotly extension from the inbuild extension manager. And I restarted the server.

此后,我的漂亮情节开始按预期渲染. :)希望这可以节省您一些时间.

My pretty plots started rendering as intended after this. :) Hope this saves you some time.

注意:将***替换为计算机上的路径

Note: replace *** with the paths on your machine

这篇关于jupyterlab-plotly构建npm扩展无法在Linux上安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆