Bläddra i källkod

Allow nodejs as a an alias to node

Steven Silvester 7 år sedan
förälder
incheckning
5a2a81d7e5
1 ändrade filer med 7 tillägg och 1 borttagningar
  1. 7 1
      jupyterlab/jlpmapp.py

+ 7 - 1
jupyterlab/jlpmapp.py

@@ -53,8 +53,14 @@ def which(command, env=None):
     env = env or os.environ
     path = env.get('PATH') or os.defpath
     command_with_path = _which(command, path=path)
+
+    # Allow nodejs as an alias to node.
+    if command == 'node' and not command_with_path:
+        command = 'nodejs'
+        command_with_path = _which('nodejs', path=path)
+
     if not command_with_path:
-        if command in ['node', 'npm']:
+        if command in ['nodejs', 'node', 'npm']:
             msg = 'Please install nodejs 5+ and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website.'
             raise ValueError(msg)
         raise ValueError('The command was not found or was not ' +