Skip to content

Commit ffa56e8

Browse files
authored
fix: Fixed npm install on Windows without having to use wsl (#502)
1 parent 754fa22 commit ffa56e8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

package.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,12 +1240,16 @@ def install_npm_requirements(query, requirements_file, tmp_dir):
12401240
shutil.copyfile(requirements_file, target_file)
12411241

12421242
subproc_env = None
1243-
if not docker and OSX:
1244-
subproc_env = os.environ.copy()
1243+
npm_exec = 'npm'
1244+
if not docker:
1245+
if WINDOWS:
1246+
npm_exec = 'npm.cmd'
1247+
elif OSX:
1248+
subproc_env = os.environ.copy()
12451249

12461250
# Install dependencies into the temporary directory.
12471251
with cd(temp_dir):
1248-
npm_command = ['npm', 'install']
1252+
npm_command = [npm_exec, 'install']
12491253
if docker:
12501254
with_ssh_agent = docker.with_ssh_agent
12511255
chown_mask = '{}:{}'.format(os.getuid(), os.getgid())

0 commit comments

Comments
 (0)