electron / electron/rebuild

[Windows] problem when rebuilding gdal

Open
#734 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.1k
Forks
181
Avg merge
6h 44m
Merged PRs (30d)
3

Description

# Version
* node = 14.16.1
* npm = 6.14.12
* windows-build-tools = 5.2.2 (I installed it with the command "npm install --vs2015 --global windows-build-tools")
* electron = 13.1.4
* electron-rebuild = 2.3.5
* gdal = 0.10.1

# Issue
it's part of my electron project's package.json
```json
"devDependencies": {
"electron": "^13.1.4",
"electron-rebuild": "^2.3.5"
},
"dependencies": {
"gdal": "^0.10.1"
}
```

I referenced the link below.
https://www.electronjs.org/docs/tutorial/using-native-node-modules

* npm config set msvs_version=2015
* set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140
* fixed to 'win_delay_load_hook': 'true' in binding.gyp of gdal

However, when the following command was executed, an error occurred while compiling.
".\node_modules\.bin\electron-rebuild.cmd"

# Error
```text
c:\users\pc\.electron-gyp\13.1.4\include\node\v8.h(1652): error C2059: syntax error: '' [C:\Users\pc\Desktop\electron_gdal\nod
e_modules\gdal\build\gdal.vcxproj]
c:\users\pc\.electron-gyp\13.1.4\include\node\v8.h(1654): error C2238: ';' Unexpected token in front. [C:\Users\pc\Desktop\ele
ctron_gdal\node_modules\gdal\build\gdal.vcxproj]
c:\users\pc\.electron-gyp\13.1.4\include\node\v8.h(1670): error C2061: syntax error: identifier 'ResolveCallback' [C:\Users\pc\Deskto
p\electron_gdal\node_modules\gdal\build\gdal.vcxproj]
c:\users\pc\.electron-gyp\13.1.4\include\node\v8.h(7292): error C2059: syntax error: '' [C:\Users\pc\Desktop\electron_gdal\nod
e_modules\gdal\build\gdal.vcxproj]
c:\users\pc\.electron-gyp\13.1.4\include\node\v8.h(8652): error C2061: syntax error: identifier 'HostImportModuleDynamicallyCallback'
[C:\Users\pc\Desktop\electron_gdal\node_modules\gdal\build\gdal.vcxproj]

...

× Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'C:\Users\pc\Desktop\electron_gdal\node_modules\gdal'.
Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1

Error: node-gyp failed to rebuild 'C:\Users\pc\Desktop\electron_gdal\node_modules\gdal'.
Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1

at ModuleRebuilder.rebuildNodeGypModule (C:\Users\pc\Desktop\electron_gdal\node_modules\electron-rebuild\lib\src\module-rebuilder.js:193:19)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Rebuilder.rebuildModuleAt (C:\Users\pc\Desktop\electron_gdal\node_modules\electron-rebuild\lib\src\rebuild.js:190:9)
at async Rebuilder.rebuild (C:\Users\pc\Desktop\electron_gdal\node_modules\electron-rebuild\lib\src\rebuild.js:152:17)
at async C:\Users\pc\Desktop\electron_gdal\node_modules\electron-rebuild\lib\src\cli.js:146:9

```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with .\node_modules\.bin\electron-rebuild.cmd and inspect the generated gdal.vcxproj alongside gdal's binding.gyp and the reported node v8.h errors. Check the electron-rebuild and node-gyp entry points named in the stack trace. Done means the gdal native module rebuild completes successfully on the stated Windows and Electron versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, node.js
Domain
build-system, devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.