You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have encountered this odd situation trying to use nw-gyp on a Windows 10 system with Python38 and Python27 in the system PATH.
On this system, if I run npm install --msvs_version=2017 via the command prompt/powershell, everything works just fine.
But when it is run via a batch file as part of a build script, the process fails, citing syntax errors that are a clear indicator it's trying to use Python 3 instead of Python 2.
I've tried various things within the batch file to encourage the right python target to be used (not all at the same time, just listing them below) and all of them were ineffectual:
set PYTHON=C:\Python27\python.exe
set npm_config_python=C:\Python27\python.exe
npm config set python C:\Python27\python.exe
npm install --python=python2.7 --msvs_version=2017
It should be noted that I can see Python27 listed in npm config ls -l and npm config get python if used in the batch file will echo the desired Python 2.7 path. At this point I have run out of ideas, it seems like all attempts to declare a target for Python are ignored when npm install is called from batch.
I do have a not-ideal workaround: if I simply shuffle the environment variables around such that Python27 is first, I can use nw-gyp without problem.
This seems rather similar to #122 (certainly, the issue of nw-gyp seemingly ignoring path variables does appear to be the case).
The text was updated successfully, but these errors were encountered:
I have encountered this odd situation trying to use nw-gyp on a Windows 10 system with Python38 and Python27 in the system PATH.
On this system, if I run
npm install --msvs_version=2017
via the command prompt/powershell, everything works just fine.But when it is run via a batch file as part of a build script, the process fails, citing syntax errors that are a clear indicator it's trying to use Python 3 instead of Python 2.
I've tried various things within the batch file to encourage the right python target to be used (not all at the same time, just listing them below) and all of them were ineffectual:
It should be noted that I can see Python27 listed in
npm config ls -l
andnpm config get python
if used in the batch file will echo the desired Python 2.7 path. At this point I have run out of ideas, it seems like all attempts to declare a target for Python are ignored whennpm install
is called from batch.I do have a not-ideal workaround: if I simply shuffle the environment variables around such that Python27 is first, I can use nw-gyp without problem.
This seems rather similar to #122 (certainly, the issue of nw-gyp seemingly ignoring path variables does appear to be the case).
The text was updated successfully, but these errors were encountered: