brianc/node-pg-native

Invalid Syntax on npm install

Closed this issue · 2 comments

kewp commented

gyp ERR! configure error
gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.% s.%s" % sys.version_info[:3];
gyp ERR! stack File "", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:276:12)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at maybeClose (internal/child_process.js:915:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces s.js:209:5)
gyp ERR! System Linux 5.1.9-arch1-1-ARCH
gyp ERR! command "/home/karl/.nvm/versions/node/v8.12.0/bin/node" "/home/karl/.n vm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp .js" "rebuild"
gyp ERR! cwd /home/karl/prices/node_modules/libpq
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0

Python version is 3.7.3. Trying to install pg-native 3.0.0

node-gyp requires Python 2. I think newer versions correctly run /usr/bin/python2, so you can either link python2 over /usr/bin/python temporarily or upgrade Node. (It might even work on the latest 8.x minor, which 8.12.0 isn’t.)

Either way, this applies to all native addons, not just pg-native.

kewp commented