Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Invalid Syntax on npm install #82

Closed
kewp opened this issue Jun 14, 2019 · 2 comments
Closed

Invalid Syntax on npm install #82

kewp opened this issue Jun 14, 2019 · 2 comments

Comments

@kewp
Copy link

kewp commented Jun 14, 2019

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

@charmander
Copy link
Collaborator

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
Copy link
Author

kewp commented Jun 16, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants