1import os 2import subprocess 3 4 5def check_node(current_dir): 6 if not os.path.exists(current_dir + '/node/node_modules'): 7 return None 8 9 try: 10 v_bytes = subprocess.check_output(['/usr/bin/env', 'node', '-v']) 11 12 return [str(v_bytes, 'utf-8').lstrip('v').rstrip()] 13 14 except subprocess.CalledProcessError: 15 return None 16