Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter Labs: "RuntimeError: npm dependencies failed to install" When Building

I'm new to using Anaconda and recently installed jupyter labs on my computer. However, any time I try to build on my local Jupyter Labs instance I get the following error:

Code run in jupyter labs terminal:

PS C:\Users\briakeit> jupyter lab build

Output:

[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

Log file:

[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

This happens anytime I try using this command (e.g. after installing anew extension). I have npm v6.4.1, nodejs v10.13.0, and yarn v1.22.0 installed in this environment according to conda. I'm running Jupyter lab 1.2.6.

Any feedback, suggestions or help would be greatly appreciated.

like image 564
Brian Keith Avatar asked Feb 17 '20 22:02

Brian Keith


2 Answers

I believe I have found the problem. I consult for a company and I was using the computer they provided me (I'm an admin on the computer). When I followed the same steps on my personal computer, it worked with no issues.

I then switched over to a different, more open network at work and the build was able to complete without errors. Clearly there is something in the firewall or something that was preventing me from doing the build.

like image 141
Brian Keith Avatar answered Oct 20 '22 02:10

Brian Keith


Not sure if you've fixed it, if not you may try the solutions below.

info There appears to be trouble with your network connection. Retrying...

This is a yarn related error that seems to suggest something wrong with your network. This can happen if the yarn was trying to connect via a proxy. You can try the following if this is the case.

npm config rm proxy
npm config rm https-proxy

It can also happen if your network is too slow. You can try increasing Yarn timeout.

yarn add <yourPackage> --network-timeout 100000

Source: https://github.com/yarnpkg/yarn/issues/4890

like image 40
AzyCrw4282 Avatar answered Oct 20 '22 02:10

AzyCrw4282