Skip to content

Commit b0c7ae4

Browse files
committed
Fix NODE_PATH on win32
1 parent 7f90039 commit b0c7ae4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pre_commit/languages/node.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,20 @@ def _envdir(prefix, version):
2424

2525

2626
def get_env_patch(venv): # pragma: windows no cover
27+
lib_dir = 'lib'
2728
if sys.platform == 'cygwin': # pragma: no cover
2829
_, win_venv, _ = cmd_output('cygpath', '-w', venv)
2930
install_prefix = r'{}\bin'.format(win_venv.strip())
3031
elif sys.platform == 'win32': # pragma: no cover
3132
install_prefix = bin_dir(venv)
33+
lib_dir = 'Scripts'
3234
else: # pragma: windows no cover
3335
install_prefix = venv
3436
return (
3537
('NODE_VIRTUAL_ENV', venv),
3638
('NPM_CONFIG_PREFIX', install_prefix),
3739
('npm_config_prefix', install_prefix),
38-
('NODE_PATH', os.path.join(venv, 'lib', 'node_modules')),
40+
('NODE_PATH', os.path.join(venv, lib_dir, 'node_modules')),
3941
('PATH', (bin_dir(venv), os.pathsep, Var('PATH'))),
4042
)
4143

0 commit comments

Comments
 (0)