Jupyterlab: Jupyter Lab failed to build

Created on 19 Jul 2020  路  1Comment  路  Source: jupyterlab/jupyterlab

Description

Jupyter lab failed to build on MacOS

  • Operating System and version: MacOS Catalina 10.15.6 (19G73)
  • JupyterLab version: 2.2.0

Context

[LabBuildApp] Building in /Users/yangcht/opt/anaconda3/share/jupyter/lab
[LabBuildApp] Node v10.13.0

[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (build:prod)
[LabBuildApp] > node /Users/yangcht/opt/anaconda3/lib/python3.7/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.61s.

[LabBuildApp] > node /Users/yangcht/opt/anaconda3/lib/python3.7/site-packages/jupyterlab/staging/yarn.js yarn-deduplicate -s fewer --fail
[LabBuildApp] yarn run v1.21.1
$ /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/.bin/yarn-deduplicate -s fewer --fail
Done in 0.83s.

[LabBuildApp] > node /Users/yangcht/opt/anaconda3/lib/python3.7/site-packages/jupyterlab/staging/yarn.js run build:prod
[LabBuildApp] yarn run v1.21.1
$ ensure-max-old-space webpack --config webpack.prod.config.js
ModuleNotFoundError: Module not found: Error: Can't resolve 'module' in '/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/lib/node'
    at factory.create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/lib/Compilation.js:925:10)
    at factory (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:401:22)
    at resolver (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:130:21)
    at asyncLib.parallel (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:224:22)
    at /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/neo-async/async.js:2830:7
    at /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/neo-async/async.js:6877:13
    at normalResolver.resolve (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:214:25)
    at doResolve (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:213:14)
    at hook.callAsync (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
    at _fn0 (eval at create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at resolver.doResolve (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7)
    at hook.callAsync (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
    at _fn0 (eval at create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at hook.callAsync (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
    at _fn0 (eval at create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at resolver.doResolve (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43)
    at hook.callAsync (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
    at _fn42 (eval at create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:28:1)
    at resolver.doResolve (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/ModuleKindPlugin.js:30:40)
    at hook.callAsync (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
    at _fn0 (eval at create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at hook.callAsync (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
    at _fn0 (eval at create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at args (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/forEachBail.js:30:14)
    at hook.callAsync (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
    at _fn0 (eval at create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at resolver.doResolve (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7)
    at hook.callAsync (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
    at _fn0 (eval at create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at hook.callAsync (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
    at _fn0 (eval at create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at resolver.doResolve (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43)
    at hook.callAsync (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
    at _fn43 (eval at create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at hook.callAsync (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
    at _fn0 (eval at create (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
resolve 'module' in '/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/lib/node'
  Parsed request is a module
  using description file: /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/package.json (relative path: ./lib/node)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/lib/node/node_modules doesn't exist or is not a directory
      /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/lib/node_modules doesn't exist or is not a directory
      /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/node_modules doesn't exist or is not a directory
      /Users/yangcht/opt/anaconda3/share/jupyter/lab/node_modules doesn't exist or is not a directory
      /Users/yangcht/opt/anaconda3/share/jupyter/node_modules doesn't exist or is not a directory
      /Users/yangcht/opt/anaconda3/share/node_modules doesn't exist or is not a directory
      /Users/yangcht/opt/anaconda3/node_modules doesn't exist or is not a directory
      /Users/yangcht/opt/node_modules doesn't exist or is not a directory
      /Users/yangcht/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/node_modules
        using description file: /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
      looking for modules in /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules
        using description file: /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/package.json (relative path: ./node_modules/module)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
          using description file: /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/package.json (relative path: ./node_modules/module)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/node_modules/module doesn't exist
            .wasm
              Field 'browser' doesn't contain a valid alias configuration
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/module doesn't exist
            .wasm
              Field 'browser' doesn't contain a valid alias configuration
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/node_modules/module.wasm doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/module.wasm doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/node_modules/module.mjs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/module.mjs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/node_modules/module.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/module.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/node_modules/module.json doesn't exist
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/module.json doesn't exist
            as directory
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/webpack/node_modules/module doesn't exist
            as directory
              /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/module doesn't exist
child_process.js:632
    throw err;
    ^

Error: Command failed: /Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/.bin/webpack --config webpack.prod.config.js
    at checkExecSyncError (child_process.js:611:11)
    at Object.execFileSync (child_process.js:629:13)
    at Object.<anonymous> (/Users/yangcht/opt/anaconda3/share/jupyter/lab/staging/node_modules/@jupyterlab/buildutils/lib/ensure-max-old-space.js:38:17)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
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 "/Users/yangcht/opt/anaconda3/lib/python3.7/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

[LabBuildApp]   File "/Users/yangcht/opt/anaconda3/lib/python3.7/site-packages/jupyterlab/labapp.py", line 138, in start
    raise e

[LabBuildApp]   File "/Users/yangcht/opt/anaconda3/lib/python3.7/site-packages/jupyterlab/labapp.py", line 135, in start
    command=command, app_options=app_options)

[LabBuildApp]   File "/Users/yangcht/opt/anaconda3/lib/python3.7/site-packages/jupyterlab/commands.py", line 460, in build
    command=command, clean_staging=clean_staging)

[LabBuildApp]   File "/Users/yangcht/opt/anaconda3/lib/python3.7/site-packages/jupyterlab/commands.py", line 661, in build
    raise RuntimeError(msg)

[LabBuildApp] RuntimeError: JupyterLab failed to build

[LabBuildApp] Exiting application: JupyterLab

Most helpful comment

I was running into this very issue today when trying to build the jupyterlab/git extension. I too am using JupyterLab version 2.2.0 and MacOS Catalina 10.15.6. While it seems like I wasn't able to get jupyter lab build to work in my base environment, I was able to get it to build by creating a new test environment in conda.

I created a new environment as follows:

conda create -n jlab-test --override-channels --strict-channel-priority -c conda-forge -c anaconda jupyterlab

and activated it with

conda activate jlab-test.

Now, I am no longer in my base environment and now am in a jlab-gtest environment. I then made sure I had nodejs=12.

conda install -c conda-forge nodejs=12

And finally, I reattempted to build jupyter lab:

jupyter lab build.

When I opened jupyter lab in this same terminal, I had the jupyterlab/git extension properly installed. Whenever you activate your jlab-test environment with the conda activate jlab-test line, you'll have the extensions in there. How to install the extensions in the base environment, I do not know.

>All comments

I was running into this very issue today when trying to build the jupyterlab/git extension. I too am using JupyterLab version 2.2.0 and MacOS Catalina 10.15.6. While it seems like I wasn't able to get jupyter lab build to work in my base environment, I was able to get it to build by creating a new test environment in conda.

I created a new environment as follows:

conda create -n jlab-test --override-channels --strict-channel-priority -c conda-forge -c anaconda jupyterlab

and activated it with

conda activate jlab-test.

Now, I am no longer in my base environment and now am in a jlab-gtest environment. I then made sure I had nodejs=12.

conda install -c conda-forge nodejs=12

And finally, I reattempted to build jupyter lab:

jupyter lab build.

When I opened jupyter lab in this same terminal, I had the jupyterlab/git extension properly installed. Whenever you activate your jlab-test environment with the conda activate jlab-test line, you'll have the extensions in there. How to install the extensions in the base environment, I do not know.

Was this page helpful?
0 / 5 - 0 ratings