Jupyter Labs: "RuntimeError: npm dependencies failed to install" When Building
Jupyter Labs: "RuntimeError: npm dependencies failed to install" When Building
我刚开始使用 Anaconda,最近在我的电脑上安装了 jupyter labs。但是,每当我尝试在我的本地 Jupyter Labs 实例上构建时,我都会收到以下错误:
jupyter 实验室终端中的代码 运行:
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 实验室 1.2.6。
如有任何反馈、建议或帮助,我们将不胜感激。
不确定您是否已修复它,如果没有,您可以尝试以下解决方案。
info There appears to be trouble with your network connection. Retrying...
这是一个与 yarn 相关的错误,似乎表明您的网络存在问题。如果 yarn 试图通过代理连接,就会发生这种情况。如果是这种情况,您可以尝试以下操作。
npm config rm proxy
npm config rm https-proxy
如果您的网络太慢,也会发生这种情况。您可以尝试增加 Yarn 超时时间。
yarn add <yourPackage> --network-timeout 100000
我相信我已经找到了问题所在。我为一家公司提供咨询,我使用的是他们提供给我的计算机(我是计算机的管理员)。当我在我的个人电脑上执行相同的步骤时,它没有任何问题。
然后我在工作时切换到另一个更开放的网络,构建能够顺利完成。很明显,防火墙中有什么东西阻止了我进行构建。
如上所述,这可能是因为您的公司强制您通过代理下载所有内容。 Yarn(用于安装 npm)默认不知道你的代理详细信息,所以你需要在你的主目录中创建一个 .yarnrc
文件(通常是 C:\Users\Username
,你需要在其中填写你自己的用户名在 windows 中,或者只是在 ubuntu 中 ~/
)。
在该文件中,您需要按如下方式指定代理设置:
https-proxy "http://username:password@proxy.address.com:port"
strict-ssl false
注意没有 =
在那里登录并在地址周围引用。
然后您就可以通过代理下载软件包了。
我遇到了同样的问题。我在不同的环境下尝试了不同版本的nodejs,但无法解决问题。我检查了日志文件,发现纱线缓存有问题,所以清除纱线缓存解决了我的问题。
从日志中可以看出:
info There appears to be trouble with your network connection.
Retrying...
我遇到了同样的问题,暂时禁用防火墙帮助我解决了部分问题,但后来我终于解决了:
jupyter lab build --dev-build=False --minimize=False
我在 运行 'jupyter lab build' 时遇到了与诺顿通知阻止 jupyter.exe 和其他一些程序相关的类似问题。我通过诺顿中的“Turn off or turn on Data Protector”或每次禁用自动保护和智能防火墙解决了这个问题 运行 'jupyter lab build'.
我刚开始使用 Anaconda,最近在我的电脑上安装了 jupyter labs。但是,每当我尝试在我的本地 Jupyter Labs 实例上构建时,我都会收到以下错误:
jupyter 实验室终端中的代码 运行:
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 实验室 1.2.6。
如有任何反馈、建议或帮助,我们将不胜感激。
不确定您是否已修复它,如果没有,您可以尝试以下解决方案。
info There appears to be trouble with your network connection. Retrying...
这是一个与 yarn 相关的错误,似乎表明您的网络存在问题。如果 yarn 试图通过代理连接,就会发生这种情况。如果是这种情况,您可以尝试以下操作。
npm config rm proxy
npm config rm https-proxy
如果您的网络太慢,也会发生这种情况。您可以尝试增加 Yarn 超时时间。
yarn add <yourPackage> --network-timeout 100000
我相信我已经找到了问题所在。我为一家公司提供咨询,我使用的是他们提供给我的计算机(我是计算机的管理员)。当我在我的个人电脑上执行相同的步骤时,它没有任何问题。
然后我在工作时切换到另一个更开放的网络,构建能够顺利完成。很明显,防火墙中有什么东西阻止了我进行构建。
如上所述,这可能是因为您的公司强制您通过代理下载所有内容。 Yarn(用于安装 npm)默认不知道你的代理详细信息,所以你需要在你的主目录中创建一个 .yarnrc
文件(通常是 C:\Users\Username
,你需要在其中填写你自己的用户名在 windows 中,或者只是在 ubuntu 中 ~/
)。
在该文件中,您需要按如下方式指定代理设置:
https-proxy "http://username:password@proxy.address.com:port"
strict-ssl false
注意没有 =
在那里登录并在地址周围引用。
然后您就可以通过代理下载软件包了。
我遇到了同样的问题。我在不同的环境下尝试了不同版本的nodejs,但无法解决问题。我检查了日志文件,发现纱线缓存有问题,所以清除纱线缓存解决了我的问题。
从日志中可以看出:
info There appears to be trouble with your network connection. Retrying...
我遇到了同样的问题,暂时禁用防火墙帮助我解决了部分问题,但后来我终于解决了:
jupyter lab build --dev-build=False --minimize=False
我在 运行 'jupyter lab build' 时遇到了与诺顿通知阻止 jupyter.exe 和其他一些程序相关的类似问题。我通过诺顿中的“Turn off or turn on Data Protector”或每次禁用自动保护和智能防火墙解决了这个问题 运行 'jupyter lab build'.