这是为了帮助那些面临类似问题的人。尝试安装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
解决方案在答案中
答案 0 :(得分:4)
如日志文件所示,问题似乎是我的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
要解决此问题,我做了以下事情:
node
的父目录node
nodejs
进行符号链接,此处命名为“节点” jupyterlab-plotly
扩展名命令如下:
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
扩展程序。然后我重新启动了服务器。
此后,我的漂亮情节开始按预期渲染。 :)希望这可以节省您一些时间。
注意:将***替换为计算机上的路径