I'm trying to run Jupyterhub on Centos 7. I know that Jupyterhub depends on a configurable-htp-proxy module provided by node, and it seems to be there and ready to run.
However - when I try to start jupyterhub it errors
jupyterhub
[I 2021-11-26 05:51:58.027 JupyterHub app:2479] Running JupyterHub version 1.5.0
[I 2021-11-26 05:51:58.028 JupyterHub app:2510] Using Authenticator: jupyterhub.auth.PAMAuthenticator-1.5.0
[I 2021-11-26 05:51:58.028 JupyterHub app:2510] Using Spawner: jupyterhub.spawner.LocalProcessSpawner-1.5.0
[I 2021-11-26 05:51:58.028 JupyterHub app:2510] Using Proxy: jupyterhub.proxy.ConfigurableHTTPProxy-1.5.0
[I 2021-11-26 05:51:58.033 JupyterHub app:1554] Loading cookie_secret from /home/centos/jupyterhub_cookie_secret
[I 2021-11-26 05:51:58.054 JupyterHub proxy:497] Generating new CONFIGPROXY_AUTH_TOKEN
[W 2021-11-26 05:51:58.055 JupyterHub app:1828] No admin users, admin interface will be unavailable.
[W 2021-11-26 05:51:58.055 JupyterHub app:1830] Add any administrative users to `c.Authenticator.admin_users` in config.
[I 2021-11-26 05:51:58.055 JupyterHub app:1859] Not using allowed_users. Any authenticated user will be allowed.
[I 2021-11-26 05:51:58.102 JupyterHub app:2549] Initialized 0 spawners in 0.002 seconds
[W 2021-11-26 05:51:58.104 JupyterHub proxy:700] Running JupyterHub without SSL. I hope there is SSL termination happening somewhere else...
[I 2021-11-26 05:51:58.105 JupyterHub proxy:703] Starting proxy @ http://:8000
[E 2021-11-26 05:51:58.107 JupyterHub proxy:716] Failed to find proxy ['configurable-http-proxy']
The proxy can be installed with `npm install -g configurable-http-proxy`.To install `npm`, install nodejs which includes `npm`.If you see an `EACCES` error or permissions error, refer to the `npm` documentation on How To Prevent Permissions Errors.
[C 2021-11-26 05:51:58.107 JupyterHub app:2755] Failed to start proxy
Traceback (most recent call last):
File "/home/centos/miniconda3/lib/python3.7/site-packages/jupyterhub/app.py", line 2753, in start
await self.proxy.start()
File "/home/centos/miniconda3/lib/python3.7/site-packages/jupyterhub/proxy.py", line 708, in start
cmd, env=env, start_new_session=True, shell=shell
File "/home/centos/miniconda3/lib/python3.7/subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "/home/centos/miniconda3/lib/python3.7/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'configurable-http-proxy': 'configurable-http-proxy'
Running ls shows the file is present.
> ls /home/centos/miniconda3/lib/node_modules
configurable-http-proxy npm
But running anything related to configurable-http-proxy fails with the following error:-
configurable-http-proxy
/home/centos/miniconda3/lib/node_modules/configurable-http-proxy/node_modules/commander/lib/command.js:866
async parseAsync(argv, parseOptions) {
^^^^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/centos/miniconda3/lib/node_modules/configurable-http-proxy/node_modules/commander/index.js:2:21)
And similarly:-
> configurable-http-proxy -V
/home/centos/miniconda3/lib/node_modules/configurable-http-proxy/node_modules/commander/lib/command.js:866
async parseAsync(argv, parseOptions) {
^^^^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/centos/miniconda3/lib/node_modules/configurable-http-proxy/node_modules/commander/index.js:2:21)
Can anyone advise on a fix?