gpt4 book ai didi

npm - jupyterlab-plotly 构建 npm 扩展在 Linux 上安装失败

转载 作者:行者123 更新时间:2023-12-05 02:08:06 26 4
gpt4 key购买 nike

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

[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 已过时。

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

$ node --version
v6.13.1

查看我机器上的 nodejs:

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

$ nodejs --version
v10.15.2

为了解决这个问题,我做了以下事情:

  1. 导航到节点的父目录
  2. 备份节点以防万一
  3. 创建了一个指向 nodejs 的符号链接(symbolic link),这里命名为“node”
  4. 运行构建
  5. 启用jupyterlab-plotly 扩展
  6. 重新启动 Jupyter Lab 服务器

命令如下:

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

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

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

在此之后,我的漂亮图开始按预期呈现。 :) 希望这能为您节省一些时间。

注意:用你机器上的路径替换***

关于npm - jupyterlab-plotly 构建 npm 扩展在 Linux 上安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61210272/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com