I am trying to install the jupyterlab plotly extension with this command (according to https://plotly.com/python/getting-started/):
jupyter labextension install jupyterlab-plotly@4.14.3
I get this error:
An error occured.
ValueError: Please install Node.js and npm before continuing installation. You may be able to install Node.js from your package manager, from conda, or directly from the Node.js website (https://nodejs.org).
See the log file for details: /tmp/jupyterlab-debug-epx8b4n6.log
I didn't install Node.js on system level, but in a virtual environment using pip. Pip list shows both nodejs 0.1.1 and npm 0.1.1 . I am also using ipywidgets in jupyterlab, which requires nodejs and it is working fine.
So I have two questions:
No, you have not installed node.js. You installed some kind of Python bindings for node (python-nodejs, with its repository archived by the author) which itself require an actual nodejs. It is dangerous to install stuff from PyPI without checking what you are installing. It could have been a malicious code - you shouldn't just type a name after pip install and hope that it installs what you think. It's the same for your npm installation (package comes from the same author); both were not updated in the last 6 years and may contain some vulnerabilities so I would uninstall those quickly ;)
It can be seen immediately from the version number that something is wrong because the current nodejs versions are generally >10, (with exact version depending on your JupyterLab version, i.e. either 10 or 12; 14 might work too).
First install nodejs latest version
conda install nodejs -c conda-forge --repodata-fn=repodata.json
Then install jupyterlab extension:
jupyter labextension install jupyterlab-plotly@4.14.3
Then RESTART JUPYTER LAB