passing python2.7 path doesnot have effect
See original GitHub issueHello, i have encountered a very annoying issue. The only workaround i have is to symlink python2.7 to python, which ofcourse breakes a lot of other programs on my system.
[shalva@archLinux loadCell2]$ cd node_modules/@serialport/bindings/
[shalva@archLinux bindings]$ ls
binding.gyp build CHANGELOG.md lib LICENSE package.json README.md src
[shalva@archLinux bindings]$ nw-gyp configure --target=0.33.0 --python /usr/bin/python2.7
gyp info it worked if it ends with ok
gyp info using nw-gyp@3.6.3
gyp info using node@10.10.0 | linux | x64
gyp info spawn /usr/bin/python2.7
gyp info spawn args [ ‘/usr/lib/node_modules/nw-gyp/gyp/gyp_main.py’,
gyp info spawn args ‘binding.gyp’,
gyp info spawn args ‘-f’,
gyp info spawn args ‘make’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/home/shalva/Projects/WebstormProjects/loadCell2/node_modules/@serialport/bindings/build/config.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/usr/lib/node_modules/nw-gyp/addon.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/home/shalva/.nw-gyp/0.33.0/common.gypi’,
gyp info spawn args ‘-Dlibrary=shared_library’,
gyp info spawn args ‘-Dvisibility=default’,
gyp info spawn args ‘-Dnode_root_dir=/home/shalva/.nw-gyp/0.33.0’,
gyp info spawn args ‘-Dnode_gyp_dir=/usr/lib/node_modules/nw-gyp’,
gyp info spawn args ‘-Dnode_lib_file=“/home/shalva/.nw-gyp/0.33.0/<(target_arch)/node.lib”’,
gyp info spawn args ‘-Dnw_lib_file=“/home/shalva/.nw-gyp/0.33.0/<(target_arch)/nw.lib”’,
gyp info spawn args ‘-Dmodule_root_dir=/home/shalva/Projects/WebstormProjects/loadCell2/node_modules/@serialport/bindings’,
gyp info spawn args ‘-Dnode_engine=v8’,
gyp info spawn args ‘–depth=.’,
gyp info spawn args ‘–no-parallel’,
gyp info spawn args ‘-Dv13=1’,
gyp info spawn args ‘–generator-output’,
gyp info spawn args ‘build’,
gyp info spawn args ‘-Goutput_dir=.’ ]
File “<string>”, line 1
import sys; print sys.byteorder
^
SyntaxError: invalid syntax
gyp: Call to ‘python -c “import sys; print sys.byteorder”’ returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp
failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/nw-gyp/lib/configure.js:359:16)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.18.6-arch1-1-ARCH
gyp ERR! command “/usr/bin/node” “/usr/bin/nw-gyp” “configure” “–target=0.33.0” “–python” “/usr/bin/python2.7”
gyp ERR! cwd /home/shalva/Projects/WebstormProjects/loadCell2/node_modules/@serialport/bindings
gyp ERR! node -v v10.10.0
gyp ERR! nw-gyp -v v3.6.3
gyp ERR! not ok
[shalva@archLinux bindings]$
it seems that there is hardcoded "python -c “import sys; print sys.byteorder” command…
P.S. this is my first issue on gihub so i wonder why code tag
removes new lines? writing without it seems to be better…
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top GitHub Comments
In Node, the issue has been patched two years ago by: https://github.com/nodejs/node/commit/3d8b844112bf6526ce126ecaec85f83b31a0a9aa
I could not quite find there the
.gypi
files are taken from to create the NWjs release files. Should maybe ask @TheJaredWilcurt.I am using a different workaround until nwjs/node#46 is (hopefully) fixed: edit
~/.nw-gyp/0.49.2/config.gypi
(replace0.49.2
with your NWjs version) and change the offendingprint sys.byteorder
toprint(sys.byteorder)
.Notice that this directory is only created after you have run
nw-gyp
for the first time with a given--target
.