Open oliTF opened 3 years ago
gdal is a native module. See the link below. https://www.electronjs.org/docs/tutorial/using-native-node-modules
However, even if you proceed as described in the link, problems arise. https://github.com/electron/electron-rebuild/issues/734
Can't compile !!! I can't compiling goal-node in my electron 11 app when I use rpm install rebuilding native dependencies dependencies=gdal@0.11.0 platform=win32 arch=x64 windows 10 nodes 16 electron 11 electron-builder 22
Please Help!
-napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v11.5' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.6
npm ERR! node-pre-gyp info using node@16.12.0 | win32 | x64
npm ERR! node-pre-gyp http GET https://github.com/naturalatlas/node-gdal/releases/download/0.11.0/electron-v11.5-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/naturalatlas/node-gdal/releases/download/0.11.0/electron-v11.5-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for gdal@0.11.0 and electron@11.5.0 (electron-v11.5 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/naturalatlas/node-gdal/releases/download/0.11.0/electron-v11.5-win32-x64-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.2.0
npm ERR! gyp info using node@16.12.0 | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.2.0
npm ERR! gyp info using node@16.12.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.8 found at "C:\Users\user\AppData\Local\Programs\Python\Python39\python.exe"
npm ERR! gyp info find VS using VS2017 (15.9.28307.1745) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\user\AppData\Local\Programs\Python\Python39\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\user\\git\\planner\\node_modules\\gdal\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\user\\git\\planner\\node_modules\\gdal\\common.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\user\\.electron-gyp\\11.5.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\user\\.electron-gyp\\11.5.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\user\\\\.electron-gyp\\\\11.5.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\Users\\user\\git\\planner\\node_modules\\gdal',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\Users\\user\\git\\planner\\node_modules\\gdal\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.2.0
npm ERR! gyp info using node@16.12.0 | win32 | x64
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\user\\git\\planner\\node_modules\\gdal\\lib\\binding\\gdal.node" "--module_name=gdal" "--module_path=C:\\Users\\user\\git\\planner\\node_modules\\gdal\\lib\\binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=electron-v11.5"
npm ERR! gyp ERR! cwd C:\Users\user\git\planner\node_modules\gdal
npm ERR! gyp ERR! node -v v16.12.0
npm ERR! gyp ERR! node-gyp -v v8.2.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! 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 build --fallback-to-build --module=C:\Users\user\git\planner\node_modules\gdal\lib\binding\gdal.node --module_name=gdal --module_path=C:\Users\user\git\planner\node_modules\gdal\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v11.5' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\user\git\planner\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19042
npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\git\\planner\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd C:\Users\user\git\planner\node_modules\gdal
npm ERR! node-pre-gyp ERR! node -v v16.12.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.6
npm ERR! node-pre-gyp ERR! not ok
Maybe you can try gdal3. js. I haven't thoroughly tested its functionality yet, but at least it can be installed。
System
node: 14.16.1 system: win10 electron: 12.0.4 node-gdal: 0.10.1
Problem
After installing and requiring with
var gdal = require("gdal");
, a cannot find module error appears:After installation, the
gdal.node
is found in followin path...\electron-quick-start\node_modules\gdal\lib\binding\node-v83-win32-x64
.I followed this issue #219 with using node-gdal 0.10.1, but I could not resolve the issue. Does it have to do something with https://github.com/mapbox/node-pre-gyp? When installing, the following warning appears:
How can this problem be resolved?