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

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

Open
lamathe opened this issue Jun 24, 2021 · 7 comments
Open

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

lamathe opened this issue Jun 24, 2021 · 7 comments

Comments

@lamathe
Copy link

lamathe commented Jun 24, 2021

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

@mkermani144
Copy link

Same happens with electron-builder.

@sergiou87
Copy link
Member

I think the problem with electron-builder is already solved in electron-builder and you only need to upgrade that package, see atom/node-keytar#380 (comment)

Maybe the issue with node-gyp is the same?

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

@mkermani144
Copy link

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).

@alamathe1
Copy link

We use electron-forge and still experience it.

@alamathe1
Copy link

alamathe1 commented Jul 2, 2021

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

@mkermani144
Copy link

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

@Rabbitzzc
Copy link

I got the same error, used node 20.x.

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

6 participants
@sergiou87 @mkermani144 @alamathe1 @Rabbitzzc @lamathe and others