Index: ensure_dependencies.py |
diff --git a/ensure_dependencies.py b/ensure_dependencies.py |
index 1cbbf09522eef68283123f634370064352ec49f1..2e7013da39ee3d207f89cbc7b0a0c0117461bc17 100755 |
--- a/ensure_dependencies.py |
+++ b/ensure_dependencies.py |
@@ -278,7 +278,16 @@ def resolve_npm_dependencies(target, vcs): |
lockfile_path = os.path.join(target, NPM_LOCKFILE) |
open(lockfile_path, 'a').close() |
- cmd = ['npm', 'install', '--only=production', '--loglevel=warn', |
+ if os.name == 'nt': |
+ # Windows' CreateProcess() (called by subprocess.Popen()) only |
+ # resolves executables ending in .exe. The windows installation of |
+ # Node.js only provides a npm.cmd, which is executable but won't |
+ # be recognized as such by CreateProcess(). |
+ npm_exec = 'npm.cmd' |
+ else: |
+ npm_exec = 'npm' |
+ |
+ cmd = [npm_exec, 'install', '--only=production', '--loglevel=warn', |
'--no-package-lock', '--no-optional'] |
subprocess.check_output(cmd, cwd=target) |