Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure error in node-gyp #1683

Closed
suvsingh opened this issue Mar 1, 2019 · 3 comments
Closed

Configure error in node-gyp #1683

suvsingh opened this issue Mar 1, 2019 · 3 comments

Comments

@suvsingh
Copy link

suvsingh commented Mar 1, 2019

  • Node Version: v10.14.2
  • Platform: WIndows 10
  • Compiler:
  • Module:
Verbose output (from npm or node-gyp):ERR! stack Error: Command failed: C:\Users\suvsingh\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info
D:\UI\_build\node_modules\.bin>node-gyp rebuild --verbose
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'D:\\UI\\_build\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose' ]
gyp info using node-gyp@3.8.0
gyp info using node@10.14.2 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\UI\_build\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\UI\_build\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\UI\_build\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\UI\_build\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\UI\_build\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\UI\_build\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\UI\_build\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\UI\_build\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\UI\_build\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\UI\_build\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\UI\_build\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\UI\_build\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21) code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Users\suvsingh\AppData\Local\Programs\Python\Python37-32\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\suvsingh\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", 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:294:12)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\UI\\_build\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose"
gyp ERR! cwd D:\UI\_build\node_modules\.bin
gyp ERR! node -v v10.14.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
@trogper
Copy link

trogper commented Mar 3, 2019

I have the same issue with python 3.6 installed.
The code for version check uses print statement, which does not exist in python 3.
In python 3, there's only print function.

change following line (in node_modules/node-gyp/lib/configure.js)
var args = ['-c', 'import sys; print "%s.%s.%s" % sys.version_info[:3];']
to this (add parentheses)
var args = ['-c', 'import sys; print ("%s.%s.%s" % sys.version_info[:3]);']

@bzoz
Copy link
Contributor

bzoz commented Mar 4, 2019

Python 3 is not supported, use Python 2.x for node-gyp

@suvsingh
Copy link
Author

suvsingh commented Mar 4, 2019

Thanks a lot guys.
I reverted to Python 2.7, and then moved ahead with the work.

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

No branches or pull requests

3 participants