Ошибка сборки JupyterLab 3.0.4. [webpack-cli] [31mTypeError: аргумент ‘compilation’ должен быть экземпляром Compilation

#jupyter #webclient #jupyter-lab

#юпитер #webclient #jupyter-лаборатория

Вопрос:

При попытке запустить jupyter lab build возникает ошибка. Я попробовал отключить jupyterlab и переустановить его, я также попробовал этот подход со всей anaconda. Я запускаю его в Windows 10. Это ошибка:

 [LabBuildApp] JupyterLab 3.0.4
[LabBuildApp] Building in c:usersacrulanaconda3sharejupyterlab
[LabBuildApp] Building jupyterlab assets (production, minimized)
Build failed.
Troubleshooting: If the build failed due to an out-of-memory error, you
may be able to fix it by disabling the `dev_build` and/or `minimize` options.

If you are building via the `jupyter lab build` command, you can disable
these options like so:

jupyter lab build --dev-build=False --minimize=False

You can also disable these options for all JupyterLab builds by adding these
lines to a Jupyter config file named `jupyter_config.py`:

c.LabBuildApp.minimize = False
c.LabBuildApp.dev_build = False

If you don't already have a `jupyter_config.py` file, you can create one by
adding a blank file of that name to any of the Jupyter config directories.
The config directories can be listed by running:

jupyter --paths

Explanation:

- `dev-build`: This option controls whether a `dev` or a more streamlined
`production` build is used. This option will default to `False` (i.e., the
`production` build) for most users. However, if you have any labextensions
installed from local files, this option will instead default to `True`.
Explicitly setting `dev-build` to `False` will ensure that the `production`
build is used in all circumstances.

- `minimize`: This option controls whether your JS bundle is minified
during the Webpack build, which helps to improve JupyterLab's overall
performance. However, the minifier plugin used by Webpack is very memory
intensive, so turning it off may help the build finish successfully in
low-memory environments.

An error occured.
RuntimeError: JupyterLab failed to build
See the log file for details:  C:UsersacrulAppDataLocalTempjupyterlab-debug-9xkqhcqu.log
 

И файл журнала. Я предполагаю, что ошибка здесь:
[webpack-cli] [31mTypeError: аргумент ‘compilation’ должен быть экземпляром компиляции
в Function.getCompilationHooks (c:usersacrulanaconda3sharejupyterlabstagingnode_moduleswebpacklibjavascriptJavascriptModulesPlugin.js:119:10)

 [LabBuildApp] Building in c:usersacrulanaconda3sharejupyterlab
[LabBuildApp] Node v14.15.4

[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (production, minimized)
[LabBuildApp] > node c:usersacrulanaconda3libsite-packagesjupyterlabstagingyarn.js install --non-interactive
[LabBuildApp] yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@2.3.1: The platform "win32" is incompatible with this module.
info "fsevents@2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "@jupyterlab/extensionmanager > react-paginate@6.5.0" has incorrect peer dependency "react@^16.0.0".
warning "@jupyterlab/json-extension > react-highlighter@0.4.3" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "@jupyterlab/json-extension > react-json-tree@0.12.1" has incorrect peer dependency "react@^16.3.0".
warning "@jupyterlab/json-extension > react-json-tree@0.12.1" has incorrect peer dependency "react-dom@^16.3.0".
warning "@jupyterlab/ui-components > @blueprintjs/core > react-popper@1.3.7" has incorrect peer dependency "react@0.14.x || ^15.0.0 || ^16.0.0".
warning "@jupyterlab/ui-components > @blueprintjs/core > react-popper > create-react-context@0.3.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "@jupyterlab/vdom > @nteract/transform-vdom@4.0.16-alpha.0" has incorrect peer dependency "react@^16.3.2".
warning " > @lumino/coreutils@1.5.3" has unmet peer dependency "crypto@1.0.1".
[5/5] Building fresh packages...
success Saved lockfile.
Done in 5.77s.

[LabBuildApp] > node c:usersacrulanaconda3libsite-packagesjupyterlabstagingyarn.js yarn-deduplicate -s fewer --fail
[LabBuildApp] yarn run v1.21.1
$ c:usersacrulanaconda3sharejupyterlabstagingnode_modules.binyarn-deduplicate -s fewer --fail
Done in 0.45s.

[LabBuildApp] > node c:usersacrulanaconda3libsite-packagesjupyterlabstagingyarn.js run build:prod:minimize
[LabBuildApp] yarn run v1.21.1
$ webpack --config webpack.prod.minimize.config.js
[webpack-cli] [31mTypeError: The 'compilation' argument must be an instance of Compilation
    at Function.getCompilationHooks (c:usersacrulanaconda3sharejupyterlabstagingnode_moduleswebpacklibjavascriptJavascriptModulesPlugin.js:119:10)
    at c:usersacrulanaconda3sharejupyterlabstagingnode_modulesterser-webpack-plugindistindex.js:566:67
    at _next35 (eval at create (c:Usersacrulanaconda3sharejupyterlabstagingnode_modulestapablelibHookCodeFactory.js:19:10), <anonymous>:40:1)
    at _next13 (eval at create (c:Usersacrulanaconda3sharejupyterlabstagingnode_modulestapablelibHookCodeFactory.js:19:10), <anonymous>:97:1)
    at Hook.eval [as call] (eval at create (c:Usersacrulanaconda3sharejupyterlabstagingnode_modulestapablelibHookCodeFactory.js:19:10), <anonymous>:127:1)
    at Hook.CALL_DELEGATE [as _call] (c:Usersacrulanaconda3sharejupyterlabstagingnode_modulestapablelibHook.js:14:14)
    at Compiler.newCompilation (c:Usersacrulanaconda3sharejupyterlabstagingnode_moduleswebpacklibCompiler.js:988:26)
    at c:Usersacrulanaconda3sharejupyterlabstagingnode_moduleswebpacklibCompiler.js:1030:29
    at Hook.eval [as callAsync] (eval at create (c:Usersacrulanaconda3sharejupyterlabstagingnode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (c:Usersacrulanaconda3sharejupyterlabstagingnode_modulestapablelibHook.js:18:14)[39m
error Command failed with exit code 2.
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:usersacrulanaconda3libsite-packagesjupyterlabdebuglog.py", line 47, in debug_logging
    yield

[LabBuildApp]   File "c:usersacrulanaconda3libsite-packagesjupyterlablabapp.py", line 168, in start
    raise e

[LabBuildApp]   File "c:usersacrulanaconda3libsite-packagesjupyterlablabapp.py", line 164, in start
    build(name=self.name, version=self.version,

[LabBuildApp]   File "c:usersacrulanaconda3libsite-packagesjupyterlabcommands.py", line 463, in build
    return handler.build(name=name, version=version, static_url=static_url,

[LabBuildApp]   File "c:usersacrulanaconda3libsite-packagesjupyterlabcommands.py", line 675, in build
    raise RuntimeError(msg)

[LabBuildApp] RuntimeError: JupyterLab failed to build

[LabBuildApp] Exiting application: JupyterLab
 

Комментарии:

1. Возможно, у вас две или более установки webpack или установлена неправильная версия webpack. github.com/jantimon/html-webpack-plugin/issues/1451 . Вы должны включить информацию о том, почему и как вы запускаете процесс сборки (поскольку обычно это не требуется для установки).

2. У меня определенно есть обновленный веб-пакет, установленный на моем компьютере. Очевидно, что это не может быть привязано к глобальной зависимости webpack, иначе это может привести к нарушению других сборок. В чем проблема?

Ответ №1:

Не уверен, как я это решил, но я неоднократно запускаю их от имени администратора

 jupyter lab clean
jupyter lab clean --all
pip uninstall jupyterlab
pip install jupyterlab
 

Затем также запустил jupyter lab сервер из другой папки, чем обычно.