registry-js icon indicating copy to clipboard operation
registry-js copied to clipboard

Node-Gyp failure while packing registry.js on Electron App

Open lamathe opened this issue 3 years ago • 6 comments

c:\users\lamathe\appdata\local\temp\electron-packager\win32-x64\chime-win32-x64\resources\app\node_modules\registry-js\node_modules\node-addon-api\napi-inl.h(1393): error C3861: 'napi_object_freeze': identifier not found [C:\Users\lamathe\AppData\Local\Temp\electron-packager\win32-x64\Chime-win32-x64\resources\app\node_modules\registry-js\build\registry.vcxproj] c:\users\lamathe\appdata\local\temp\electron-packager\win32-x64\chime-win32-x64\resources\app\node_modules\registry-js\node_modules\node-addon-api\napi-inl.h(1399): error C3861: 'napi_object_seal': identifier not found [C:\Users\lamathe\AppData\Local\Temp\electron-packager\win32-x64\Chime-win32-x64\resources\app\node_modules\registry-js\build\registry.vcxproj]

An unhandled error has occurred inside Forge: node-gyp failed to rebuild 'C:\Users\lamathe\AppData\Local\Temp\electron-packager\win32-x64\Chime-win32-x64\resources\app\node_modules\registry-js'. Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1

Error: node-gyp failed to rebuild 'C:\Users\lamathe\AppData\Local\Temp\electron-packager\win32-x64\Chime-win32-x64\resources\app\node_modules\registry-js'. Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1

at ModuleRebuilder.rebuildNodeGypModule (C:\Users\lamathe\Documents\GitHub\ChimeElectron\src\ChimeElectron\node_modules\electron-rebuild\src\module-rebuilder.ts:231:13)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at Rebuilder.rebuildModuleAt (C:\Users\lamathe\Documents\GitHub\ChimeElectron\src\ChimeElectron\node_modules\electron-rebuild\src\rebuild.ts:283:5)
at Rebuilder.rebuild (C:\Users\lamathe\Documents\GitHub\ChimeElectron\src\ChimeElectron\node_modules\electron-rebuild\src\rebuild.ts:189:9)
at C:\Users\lamathe\Documents\GitHub\ChimeElectron\src\ChimeElectron\node_modules\@electron-forge\core\src\util\rebuild.ts:33:5

Error while packaging the electron app

lamathe avatar Jun 24 '21 06:06 lamathe

Same happens with electron-builder.

mkermani144 avatar Jul 01 '21 10:07 mkermani144

I think the problem with electron-builder is already solved in electron-builder and you only need to upgrade that package, see https://github.com/atom/node-keytar/issues/380#issuecomment-860445051

Maybe the issue with node-gyp is the same?

registry-js is used by GitHub Desktop and it builds without problems 🤔

sergiou87 avatar Jul 01 '21 11:07 sergiou87

I don't know if it's a electron-builder, node-gyp or repo issue, but it still exists in the latest version of electron-builder (22.11.7 at this time).

mkermani144 avatar Jul 01 '21 12:07 mkermani144

We use electron-forge and still experience it.

alamathe1 avatar Jul 02 '21 18:07 alamathe1

Quick update, it works on the following:

node -v
v14.16.0
npm -v
6.14.11

The above uses NAPI_VERSION=7 but latest node where is is broken on uses 8.

Failure is at https://nodejs.org/api/n-api.html; https://github.com/nodejs/node-addon-api/blob/main/napi-inl.h#L1391-L1403

alamathe1 avatar Jul 02 '21 20:07 alamathe1

It seems a npm bug. I used yarn to install deps and it all works fine.

mkermani144 avatar Jul 03 '21 10:07 mkermani144