我在本地主机上运行的管道代理上的 Azure 管道中运行 docker build 任务。我正在尝试“运行 jupyter labextension install @jupyter-widgets/jupyterlab-manager”。
在基础图像中:
node=14.14.0
jupyter=1.0.0
jupyter-packaging = 0.7.12
jupyter-resource-usage= 0.5.1
jupyter_client = 6.1.7
jupyter_console = 6.2.0
jupyter_core = 4.7.0
jupyter_server = 1.6.1
jupyter_telemetry = 0.1.0
jupyterhub = 1.3.0
jupyterhub-base = 1.3.0
jupyterlab = 3.0.12
jupyterlab-git = 0.30.0b2
jupyterlab-templates = 0.2.5
jupyterlab_code_formatter=1.4.5
jupyterlab_pygments = 0.1.2
jupyterlab_server = 2.3.0
Dockerfile 看起来像这样:
USER root
COPY files/.npmrc $HOME/.npmrc
RUN jupyter labextension install --no-build @jupyter-widgets/jupyterlab-manager .....
.npmrc 看起来像这样:
always-auth=true
strict-ssl=false
registry=https://pkgs.dev.azure.com/org-name/proj-name/_packaging/proj-name/npm/registry/
https-proxy=the-proxy-url
proxy=the-proxy-url
管道执行以下任务:
- 在 .npmrc 上运行 npmAuthenticate 任务以使用 auth-token 编辑 .npmrc 文件。这个成功了。。
- 接下来运行 docker build。Dockerfile 指示将此修改后的 .npmrc 复制到 $HOME 并尝试安装实验室扩展
找到这个线程:https ://github.com/jupyter-widgets/ipywidgets/issues/1982#issuecomment-468716770 我们使用jupyterlab v3。所以 node>=12 是必需的。所以我将 Dockerfile 更改为:
USER root
COPY files/.npmrc $HOME/.npmrc
RUN conda remove nodejs && conda install -c conda-forge nodejs=12 && conda list | grep nodejs &&\
jupyter labextension install --no-build @jupyter-widgets/jupyterlab-manager .....
也试过这个:https ://stackoverflow.com/a/52484330/3575135 。没有帮助
正常的“npm install @angular/cli”可以工作。但是实验室的扩展让我很难过。在这一点上似乎没有任何工作..
这是错误:
ValueError: "@jupyter-widgets/jupyterlab-manager" is not a valid npm package
请帮忙!