'Jupyter notebook Application launch error

When I try to launch Jupyter notebook from Anaconda3 I get this Application launch error:

Fail to get yarn configuration. /root/anaconda3/lib/python3.8/site-packages/jupyterlab/staging/yarn.js:1175
var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = new Set()) {
^

SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:140:18)
at node.js:1043:3

[I 22:16:35.920 NotebookApp] JupyterLab extension loaded from /root/anaconda3/lib/python3.8/site-packages/jupyterlab
[I 22:16:35.920 NotebookApp] JupyterLab application directory is /root/anaconda3/share/jupyter/lab
[C 22:16:35.923 NotebookApp] Running as root is not recommended. Use --allow-root to bypass.

I'm using kali linux, I try to update jupyter but nothing change.



Solution 1:[1]

Updating nodejs resolved this for me

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
apt-get install -y nodejs

You can refer to this link https://github.com/yarnpkg/yarn/issues/6914

Solution 2:[2]

check this:

conda install -c conda-forge nodejs

works for me

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lamp
Solution 2 S.B