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

The tilemaker needs python 2.7 and the installer build needs python 3 #156

Open
peterhambly opened this issue Apr 17, 2019 · 2 comments
Open

Comments

@peterhambly
Copy link
Contributor

The python installer requires python3 to run. Node.js has only recently shifted to Python 3 and not all the npn libraries have been migrated to python 3. This in particular impacts:

  • pg-native (Native Postgres - which you can do without)
  • node-gdal. This is a new dependency when the npn packages are brought up to data:
C:\Users\phamb\Documents\GitHub\rapidInquiryFacility\rifNodeServices>npm install gdal

> gdal@0.9.8 install C:\Users\phamb\Documents\GitHub\rapidInquiryFacility\rifNodeServices\node_modules\gdal
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/gdal/v0.9.8/node-v64-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for gdal@0.9.8 and node@10.15.3 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\phamb\AppData\Local\Programs\Python\Python37\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:189:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:970:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\phamb\\Documents\\GitHub\\rapidInquiryFacility\\rifNodeServices\\node_modules\\gdal\\lib\\binding\\node-v64-win32-x64\\gdal.node" "--module_name=gdal" "--module_path=C:\\Users\\phamb\\Documents\\GitHub\\rapidInquiryFacility\\rifNodeServices\\node_modules\\gdal\\lib\\binding\\node-v64-win32-x64" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd C:\Users\phamb\Documents\GitHub\rapidInquiryFacility\rifNodeServices\node_modules\gdal
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\phamb\Documents\GitHub\rapidInquiryFacility\rifNodeServices\node_modules\gdal\lib\binding\node-v64-win32-x64\gdal.node --module_name=gdal --module_path=C:\Users\phamb\Documents\GitHub\rapidInquiryFacility\rifNodeServices\node_modules\gdal\lib\binding\node-v64-win32-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\phamb\Documents\GitHub\rapidInquiryFacility\rifNodeServices\node_modules\gdal\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:970:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Windows_NT 10.0.17763
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\phamb\\Documents\\GitHub\\rapidInquiryFacility\\rifNodeServices\\node_modules\\gdal\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\phamb\Documents\GitHub\rapidInquiryFacility\rifNodeServices\node_modules\gdal
node-pre-gyp ERR! node -v v10.15.3
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\phamb\Documents\GitHub\rapidInquiryFacility\rifNodeServices\node_modules\gdal\lib\binding\node-v64-win32-x64\gdal.node --module_name=gdal --module_path=C:\Users\phamb\Documents\GitHub\rapidInquiryFacility\rifNodeServices\node_modules\gdal\lib\binding\node-v64-win32-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gdal@0.9.8 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gdal@0.9.8 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\phamb\AppData\Roaming\npm-cache\_logs\2019-04-14T10_05_19_544Z-debug.log

This should resolve itself in the next month or so.

@devilgate
Copy link
Member

You could consider using Python's virtual environments to work around this. I haven't used them myself, but this looks like a useful primer on them.

I'm surprised anything in Node relies on Python, I must say.

@peterhambly
Copy link
Contributor Author

The Node core is the Chrome javascript engine. The npn modules use Python for build/integration and Javascript for the code. They can access external libraries as is the case above.

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

2 participants