dfellis / h3-node

H3 binding to Node using N-API
MIT License
30 stars 5 forks source link

Facing Issue while installing h3-node on windows 8 through cygwin #32

Closed PranjalGuptaSwaniti closed 4 years ago

PranjalGuptaSwaniti commented 4 years ago

I am facing issue as mentioned below while installing the h3-node :

C:\users\pranjal gupta\Desktop\app-server\node_modules\h3-node>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild --target=10.16.0 --target_arch=x64 --release ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --target=10.16.0 --target_arch=x64 --release ) gyp ERR! configure error gyp ERR! stack Error: Command failed: C:\Users\Pranjal Gupta\AppData\Local\Programs\Python\Python38\python.EXE -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:294:12) gyp ERR! stack at ChildProcess.emit (events.js:198:13) gyp ERR! stack at maybeClose (internal/child_process.js:982:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) gyp ERR! System Windows_NT 6.3.9600 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--target=10.16.0" "--target_arch=x64" "--release" gyp ERR! cwd C:\users\pranjal gupta\Desktop\app-server\node_modules\h3-node gyp ERR! node -v v10.16.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-gyp exited with 1 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! h3-node@3.6.4 prebuild: bash .prebuild.sh npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the h3-node@3.6.4 prebuild script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Pranjal Gupta\AppData\Roaming\npm-cache_logs\2020-04-08T05_42_42_844Z-debug.log npm WARN rbush-knn@2.1.0 requires a peer of rbush@^2.0.2 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! h3-node@3.6.4 install: bash -c "if node-gyp-build-test; then node-gyp-build; else npm run prebuild && node-gyp-build; fi" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the h3-node@3.6.4 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Pranjal Gupta\AppData\Roaming\npm-cache_logs\2020-04-08T05_42_44_597Z-debug.log

dfellis commented 4 years ago
gyp ERR! stack Error: Command failed: C:\Users\Pranjal Gupta\AppData\Local\Programs\Python\Python38\python.EXE -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

This fragment is key. You're using Python 3.8 but python is complaining that the print statement is invalid syntax. That code looks like Python 2.x-style code (with a print statement instead of a print() function).

Further down, I see this:

gyp ERR! node-gyp -v v3.8.0

And checking the README for node-gyp at v.3.8.0 it says:

python (v2.7 recommended, v3.x.x is not supported)

But I noticed on the README for the latest release of node-gyp:

Python v2.7, v3.5, v3.6, v3.7, or v3.8

So there are a couple of approaches here:

  1. If you need something done fast, getting Python 2.7 set up in your Cygwin install should unblock you here pretty quickly.
  2. I should upgrade the node-gyp dependency to the latest, but it's two major versions ahead of what I have installed, so I don't know how long that upgrade will really take. It might be much longer and require rewriting some of the configuration or possibly even the binding code, so I don't know when that'll be ready for you.
dfellis commented 4 years ago

A python 3.x-compatible version of h3-node has been released as v3.6.5

PranjalGuptaSwaniti commented 4 years ago

Hi @dfellis , Why do we need Visual Studio now ?? I am getting this error now during installation of 3.6.5

gyp ERR! find VS gyp ERR! find VS msvs_version not set from command line or npm config gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt gyp ERR! find VS checking VS2017 (15.9.28307.586) found at: gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community" gyp ERR! find VS - found "Visual Studio C++ core features" gyp ERR! find VS - missing any VC++ toolset gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use gyp ERR! find VS looking for Visual Studio 2015 gyp ERR! find VS - not found gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8

dfellis commented 4 years ago

Because it is detecting that you're running Windows and the vast majority of Windows users would compile with VS.

Can you paste the entire CLI output? And can you paste what running command -v make returns from the cygwin CLI?

I also expect trouble from the upstream H3 cmake config when it gets to that point.