web-dev-qa-db-ja.com

Jupyter Labs:「RuntimeError:npm dependency failed to install」ビルド時に

Anacondaを初めて使用し、最近コンピューターにjupyterラボをインストールしました。ただし、ローカルのJupyter Labsインスタンスでビルドしようとすると、常に次のエラーが発生します。

Jupyter labsターミナルで実行されるコード:

PS C:\Users\briakeit> jupyter lab build

出力:

[LabBuildApp] JupyterLab 1.2.5
[LabBuildApp] Building in C:\Users\briakeit\AnacondaFiles\share\jupyter\lab
[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: npm dependencies failed to install
See the log file for details:  C:\Users\briakeit\AppData\Local\Temp\jupyterlab-debug-0b5ejkfm.log

ログファイル:

[LabBuildApp] Building in C:\Users\briakeit\AnacondaFiles\share\jupyter\lab
[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Node v13.7.0

[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
[LabBuildApp] > node C:\Users\briakeit\AnacondaFiles\lib\site-packages\jupyterlab\staging\yarn.js install --non-interactive
[LabBuildApp] yarn install v1.15.2
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/@jupyterlab/application-extension/-/application-extension-1.2.1.tgz: read ECONNRESET".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\briakeit\\AnacondaFiles\\share\\jupyter\\lab\\staging\\yarn-error.log".
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 "C:\Users\briakeit\AnacondaFiles\lib\site-packages\jupyterlab\debuglog.py", line 47, in debug_logging
    yield

[LabBuildApp]   File "C:\Users\briakeit\AnacondaFiles\lib\site-packages\jupyterlab\labapp.py", line 98, in start
    command=command, app_options=app_options)

[LabBuildApp]   File "C:\Users\briakeit\AnacondaFiles\lib\site-packages\jupyterlab\commands.py", line 459, in build
    command=command, clean_staging=clean_staging)

[LabBuildApp]   File "C:\Users\briakeit\AnacondaFiles\lib\site-packages\jupyterlab\commands.py", line 660, in build
    raise RuntimeError(msg)

[LabBuildApp] RuntimeError: npm dependencies failed to install

[LabBuildApp] Exiting application: JupyterLab

これは、このコマンドを使用しようとするたびに発生します(たとえば、新しい拡張機能をインストールした後)。 condaによると、npm v6.4.1、nodejs v10.13.0、yarn v1.22.0がこの環境にインストールされています。 Jupyter lab 1.2.6を実行しています。

フィードバック、提案、ヘルプをいただければ幸いです。

2
Brian Keith

修正したかどうかわからない場合は、以下の解決策を試してください。

infoネットワーク接続に問題があるようです。再試行しています...

これは、ネットワークに問題があることを示唆する糸関連のエラーです。これは、糸がプロキシ経由で接続しようとした場合に発生する可能性があります。その場合は、次のことを試してみてください。

npm config rm proxy
npm config rm https-proxy

ネットワークが遅すぎる場合にも発生する可能性があります。糸のタイムアウトを長くしてみてください。

yarn add <yourPackage> --network-timeout 100000

ソース: https://github.com/yarnpkg/yarn/issues/489

1
AzyCrw4282

私は問題を見つけたと思います。私は会社に相談し、彼らが提供したコンピューターを使用していました(私はコンピューターの管理者です)。私のパソコンで同じ手順を実行したところ、問題なく動作しました。

次に、職場でよりオープンな別のネットワークに切り替えたところ、エラーなしでビルドを完了できました。明らかに、ファイアウォールに何かがあるか、または私がビルドを行うのを妨げていた何かがあります。

0
Brian Keith