From ffa56e896d7c5e5c8cbc851f0c453b70e4ec100f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Eickvonder?= Date: Thu, 5 Oct 2023 17:21:40 +0200 Subject: [PATCH] fix: Fixed npm install on Windows without having to use wsl (#502) --- package.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/package.py b/package.py index e2bdadfd..20ba4fdf 100644 --- a/package.py +++ b/package.py @@ -1240,12 +1240,16 @@ def install_npm_requirements(query, requirements_file, tmp_dir): shutil.copyfile(requirements_file, target_file) subproc_env = None - if not docker and OSX: - subproc_env = os.environ.copy() + npm_exec = 'npm' + if not docker: + if WINDOWS: + npm_exec = 'npm.cmd' + elif OSX: + subproc_env = os.environ.copy() # Install dependencies into the temporary directory. with cd(temp_dir): - npm_command = ['npm', 'install'] + npm_command = [npm_exec, 'install'] if docker: with_ssh_agent = docker.with_ssh_agent chown_mask = '{}:{}'.format(os.getuid(), os.getgid())