由于构建错误,无法在JupyterLab中添加扩展

时间:2020-06-24 00:41:11

标签: python jupyter-notebook anaconda jupyter-lab

每当我在JupyterLab中添加扩展名时,它都会要求我更改构建,但是每次我运行命令[LabBuildApp] Building in c:\users\20-06\anaconda3\share\jupyter\lab [LabBuildApp] Node v12.18.1 [LabBuildApp] Yarn configuration loaded. [LabBuildApp] Building jupyterlab assets (build:prod:minimize) [LabBuildApp] > node c:\users\20-06\anaconda3\lib\site-packages\jupyterlab\staging\yarn.js install --non-interactive [LabBuildApp] yarn install v1.21.1 [1/5] Validating package.json... [2/5] Resolving packages... success Already up-to-date. Done in 0.83s. [LabBuildApp] > node c:\users\20-06\anaconda3\lib\site-packages\jupyterlab\staging\yarn.js yarn-deduplicate -s fewer --fail [LabBuildApp] yarn run v1.21.1 $ c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\.bin\yarn-deduplicate -s fewer --fail Done in 0.69s. [LabBuildApp] > node c:\users\20-06\anaconda3\lib\site-packages\jupyterlab\staging\yarn.js run build:prod:minimize [LabBuildApp] yarn run v1.21.1 $ ensure-max-old-space webpack --config webpack.prod.minimize.config.js ModuleNotFoundError: Module not found: Error: Can't resolve 'net' in 'c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\vscode-jsonrpc\lib' at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\webpack\lib\Compilation.js:925:10 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\webpack\lib\NormalModuleFactory.js:401:22 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\webpack\lib\NormalModuleFactory.js:130:21 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\webpack\lib\NormalModuleFactory.js:224:22 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\neo-async\async.js:2830:7 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\neo-async\async.js:6877:13 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\webpack\lib\NormalModuleFactory.js:214:25 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:184:12 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:238:5 at eval (eval at create (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1) at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:37:5 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:238:5 at eval (eval at create (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1) at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:238:5 at eval (eval at create (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:25:1) at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:42:38 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:238:5 at eval (eval at create (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:26:1) at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\ModuleKindPlugin.js:23:37 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:238:5 at eval (eval at create (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1) at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:238:5 at eval (eval at create (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1) at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\forEachBail.js:30:14 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:238:5 at eval (eval at create (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1) at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:37:5 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:238:5 at eval (eval at create (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1) at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:238:5 at eval (eval at create (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:25:1) at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:42:38 at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:238:5 at eval (eval at create (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:14:1) at c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\enhanced-resolve\lib\Resolver.js:238:5 at eval (eval at create (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:25:1) resolve 'net' in 'c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\vscode-jsonrpc\lib' Parsed request is a module using description file: c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\vscode-jsonrpc\package.json (relative path: ./lib) Field 'browser' doesn't contain a valid alias configuration resolve as module c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\vscode-jsonrpc\lib\node_modules doesn't exist or is not a directory c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\vscode-jsonrpc\node_modules doesn't exist or is not a directory c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\node_modules doesn't exist or is not a directory c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\node_modules doesn't exist or is not a directory c:\users\20-06\anaconda3\share\jupyter\lab\node_modules doesn't exist or is not a directory c:\users\20-06\anaconda3\share\jupyter\node_modules doesn't exist or is not a directory c:\users\20-06\anaconda3\share\node_modules doesn't exist or is not a directory c:\users\20-06\anaconda3\node_modules doesn't exist or is not a directory c:\users\20-06\node_modules doesn't exist or is not a directory c:\users\node_modules doesn't exist or is not a directory c:\node_modules doesn't exist or is not a directory looking for modules in c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules using description file: c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\package.json (relative path: ./node_modules) Field 'browser' doesn't contain a valid alias configuration looking for modules in c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules using description file: c:\users\20-06\anaconda3\share\jupyter\lab\staging\package.json (relative path: ./node_modules) Field 'browser' doesn't contain a valid alias configuration using description file: c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\package.json (relative path: ./node_modules/net) no extension Field 'browser' doesn't contain a valid alias configuration using description file: c:\users\20-06\anaconda3\share\jupyter\lab\staging\package.json (relative path: ./node_modules/net) no extension Field 'browser' doesn't contain a valid alias configuration c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\net doesn't exist .wasm Field 'browser' doesn't contain a valid alias configuration c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\net doesn't exist .wasm Field 'browser' doesn't contain a valid alias configuration c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\net.wasm doesn't exist .mjs Field 'browser' doesn't contain a valid alias configuration c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\net.wasm doesn't exist .mjs Field 'browser' doesn't contain a valid alias configuration c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\net.mjs doesn't exist .js Field 'browser' doesn't contain a valid alias configuration c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\net.mjs doesn't exist .js Field 'browser' doesn't contain a valid alias configuration c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\net.js doesn't exist .json Field 'browser' doesn't contain a valid alias configuration c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\net.js doesn't exist .json Field 'browser' doesn't contain a valid alias configuration c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\net.json doesn't exist c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\net.json doesn't exist as directory c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\vscode-languageserver-protocol\node_modules\net doesn't exist as directory c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\net doesn't exist child_process.js:651 throw err; ^ Error: Command failed: c:\users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\.bin\webpack.CMD --config webpack.prod.minimize.config.js at checkExecSyncError (child_process.js:630:11) at Object.execFileSync (child_process.js:648:15) at Object.<anonymous> (c:\Users\20-06\anaconda3\share\jupyter\lab\staging\node_modules\@jupyterlab\buildutils\lib\ensure-max-old-space.js:50:17) at Module._compile (internal/modules/cjs/loader.js:1138:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 { status: 1, signal: null, output: [ null, null, null ], pid: 16432, stdout: null, stderr: null } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [LabBuildApp] JupyterLab failed to build [LabBuildApp] Traceback (most recent call last): [LabBuildApp] File "c:\users\20-06\anaconda3\lib\site-packages\jupyterlab\debuglog.py", line 47, in debug_logging yield [LabBuildApp] File "c:\users\20-06\anaconda3\lib\site-packages\jupyterlab\labapp.py", line 138, in start raise e [LabBuildApp] File "c:\users\20-06\anaconda3\lib\site-packages\jupyterlab\labapp.py", line 135, in start command=command, app_options=app_options) [LabBuildApp] File "c:\users\20-06\anaconda3\lib\site-packages\jupyterlab\commands.py", line 460, in build command=command, clean_staging=clean_staging) [LabBuildApp] File "c:\users\20-06\anaconda3\lib\site-packages\jupyterlab\commands.py", line 661, in build raise RuntimeError(msg) [LabBuildApp] RuntimeError: JupyterLab failed to build [LabBuildApp] Exiting application: JupyterLab 时,都会出现以下错误:go=True while go: names=[] x=input('Write a name: ') names.append(x) print(names) 。我已经尝试过从提出同样问题的人们那里获得各种解决方案,但是都没有奏效。这是运行此命令时的日志文件:

{{1}}

有上百万个错误,但我不确定是什么原因引起的。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

这很可能是由于您在jupyterlab中安装了另一个扩展名(对我来说是jupyterlab-latex)。

根据您的错误路径进行快速谷歌搜索表明,在您的情况下,它可能是jupyter-lsp(注意:它在<2.1.0a0的jupyterlab版本中具有上限)。试试

jupyter labextension uninstall @krassowski/jupyterlab-lsp
pip uninstall jupyter-lsp
jupyter lab build