quigleyj97/jupyterlab-spreadsheet

Install fails with "npm dependencies failed to install"

tharwan opened this issue · 4 comments

Hi,

I tried to install in the jupyter/minimal-notebook docker container and it fails with:

>>> jupyter labextension install jupyterlab-spreadsheet
Building jupyterlab assets (development)
An error occurred.
RuntimeError: npm dependencies failed to install
See the log file for details:  /tmp/jupyterlab-debug-n8jgnx4o.log

The log says:

error expose-loader@3.1.0: The engine "node" is incompatible with this module. Expected version ">= 12.13.0". Got "12.4.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

npm dependencies failed to install
Traceback (most recent call last):

  File "/opt/conda/lib/python3.9/site-packages/jupyterlab/debuglog.py", line 48, in debug_logging
    yield

  File "/opt/conda/lib/python3.9/site-packages/jupyterlab/labextensions.py", line 140, in start
    build(clean_staging=self.should_clean,

  File "/opt/conda/lib/python3.9/site-packages/jupyterlab/commands.py", line 482, in build
    return handler.build(name=name, version=version, static_url=static_url,

  File "/opt/conda/lib/python3.9/site-packages/jupyterlab/commands.py", line 688, in build
    raise RuntimeError(msg)

RuntimeError: npm dependencies failed to install

Exiting application: lab

Any help is greatly appreciated!

Hi, thanks for submitting this big report!

I'll take a look this weekend, but expose-loader is used by this extension to provide JQuery to SlickGrid. The error log you shared indicates that this dependency doesn't support Node 12- I expect this can be fixed by bumping the requested version of expose-loader, but in the meantime you can work around this by downgrading to an earlier version of Node.

Actually it seems I had this wrong- I had missed that the error was that the semver was expecting a node version greater than or equal to 12.13. Digging into this more:

The minimal-notebook Docker image is based on a base Docker image, which in turn is based on Ubuntu 20.04, and the version of node included with this is 10.19, which is no longer supported which would explain the gte 12 check in expose-loader.

I would recommend updating the version of node you use by adding something like this to your dockerfile:

RUN curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
RUN sudo apt-get install -y nodejs

This pulls in the current LTS release of node from NodeSource and will let you subsequently install jupyterlab-spreadsheet into your container.

If you aren't using a dockerfile but deploying minimal-notebook directly, you can run these commands in a terminal, minus the RUN bit, and the end effect will be the same.

Closing, but feel free to reopen if you're still facing issues!

Thanks so much for the advise! I will check if there is an open issue to update node in the notebook image too.

FYI nodejs seems to be installed via conda, and the images use mamba as package manager for conda, hence I had to do:
RUN mamba install nodejs==16.12.0