I have a problem launching a npm command via a python script.
from Run npm commands using Python subprocess I found that the following should work:
subprocess.check_call('start npm run features:chrome:server', shell=True)
and it does (!).
From documentation (https://docs.python.org/3/library/subprocess.html), I read that subprocess.check_call
is equivalent to run(..., check=True)
As I previousely used subprocess.run to launch an external application (newman) with success, I tried the following:
subprocess.run("start npm run features:chrome:server", check=True)
but it ends up with an error:
Traceback (most recent call last):
File "test_differentiel.py", line 73, in <module>
subprocess.run("start npm run features:chrome:server")
File "C:\Users\a.joly\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\a.joly\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "C:\Users\a.joly\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 990, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable
Any idea of why I can't use subprocess.run ? (nor check_output, by the way ...)