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

[Bug]: electron-builder install-app-deps failing post electron upgrade to v32.0.0 and v32.0.1 #43510

Closed
3 tasks done
amitparida opened this issue Aug 29, 2024 · 15 comments
Closed
3 tasks done

Comments

@amitparida
Copy link

amitparida commented Aug 29, 2024

Preflight Checklist

Electron Version

v32.0.1

What operating system(s) are you using?

macOS

Operating System Version

macOS Sonoma 14.6.1

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

31.1.0

Expected Behavior

When upraded electron to v32.0.0 or v32.0.1, the npm install command fails with the following error

amitpari@c889f3ed480e EPIManualMappingTool % npm i

> [email protected] postinstall
> node license-validator.js && electron-builder install-app-deps

Validating software licenses with abc's policy
  • electron-builder  version=24.13.3
  • loaded configuration  file=package.json ("build" field)
  • Specified application directory equals to project dir — superfluous or wrong configuration  appDirectory=./
  • rebuilding native dependencies  [email protected], [email protected] platform=darwin arch=arm64
  ⨯ cannot execute  cause=exit status 1
                    errorOut=npm error code 1
    npm error path /Volumes/workplace/EPIManualMappingTool/node_modules/node-expat
    npm error command failed
    npm error command sh -c node-gyp rebuild
    npm error CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlparse.o
    npm error   CC(target) Release/obj.target/expat/deps/libexpat/lib/xmltok.o
    npm error   CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlrole.o
    npm error   LIBTOOL-STATIC Release/libexpat.a
    npm error   CXX(target) Release/obj.target/node_expat/node-expat.o
    npm error gyp info it worked if it ends with ok
    npm error gyp info using [email protected]
    npm error gyp info using [email protected] | darwin | arm64
    npm error gyp info find Python using Python version 3.12.5 found at "/opt/homebrew/opt/[email protected]/bin/python3.12"
    npm error gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.12
    npm error gyp info spawn args [
    npm error gyp info spawn args '/Volumes/workplace/EPIManualMappingTool/node_modules/node-gyp/gyp/gyp_main.py',
    npm error gyp info spawn args 'binding.gyp',
    npm error gyp info spawn args '-f',
    npm error gyp info spawn args 'make',
    npm error gyp info spawn args '-I',
    npm error gyp info spawn args '/Volumes/workplace/EPIManualMappingTool/node_modules/node-expat/build/config.gypi',
    npm error gyp info spawn args '-I',
    npm error gyp info spawn args '/Volumes/workplace/EPIManualMappingTool/node_modules/node-gyp/addon.gypi',
    npm error gyp info spawn args '-I',
    npm error gyp info spawn args '/Users/amitpari/.electron-gyp/32.0.1/include/node/common.gypi',
    npm error gyp info spawn args '-Dlibrary=shared_library',
    npm error gyp info spawn args '-Dvisibility=default',
    npm error gyp info spawn args '-Dnode_root_dir=/Users/amitpari/.electron-gyp/32.0.1',
    npm error gyp info spawn args '-Dnode_gyp_dir=/Volumes/workplace/EPIManualMappingTool/node_modules/node-gyp',
    npm error gyp info spawn args '-Dnode_lib_file=/Users/amitpari/.electron-gyp/32.0.1/<(target_arch)/node.lib',
    npm error gyp info spawn args '-Dmodule_root_dir=/Volumes/workplace/EPIManualMappingTool/node_modules/node-expat',
    npm error gyp info spawn args '-Dnode_engine=v8',
    npm error gyp info spawn args '--depth=.',
    npm error gyp info spawn args '--no-parallel',
    npm error gyp info spawn args '--generator-output',
    npm error gyp info spawn args 'build',
    npm error gyp info spawn args '-Goutput_dir=.'
    npm error gyp info spawn args ]
    npm error gyp info spawn make
    npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
    npm error ./Release/.deps/Release/obj.target/expat/deps/libexpat/lib/xmlparse.o.d.raw Stats {
    npm error   dev: 16777232,
    npm error   mode: 33188,
    npm error   nlink: 1,
    npm error   uid: 503,
    npm error   gid: 20,
    npm error   rdev: 0,
    npm error   blksize: 4096,
    npm error   ino: 14319624,
    npm error   size: 359,
    npm error   blocks: 8,
    npm error   atimeMs: 1724969408000,
    npm error   mtimeMs: 1724969408000,
    npm error   ctimeMs: 1724969408898.0571,
    npm error   birthtimeMs: 1724969408000
    npm error }
    npm error ./Release/.deps/Release/obj.target/expat/deps/libexpat/lib/xmltok.o.d.raw Stats {
    npm error   dev: 16777232,
    npm error   mode: 33188,
    npm error   nlink: 1,
    npm error   uid: 503,
    npm error   gid: 20,
    npm error   rdev: 0,
    npm error   blksize: 4096,
    npm error   ino: 14319631,
    npm error   size: 535,
    npm error   blocks: 8,
    npm error   atimeMs: 1724969409000,
    npm error   mtimeMs: 1724969409000,
    npm error   ctimeMs: 1724969409580.7559,
    npm error   birthtimeMs: 1724969409000
    npm error }
    npm error ./Release/.deps/Release/obj.target/expat/deps/libexpat/lib/xmlrole.o.d.raw Stats {
    npm error   dev: 16777232,
    npm error   mode: 33188,
    npm error   nlink: 1,
    npm error   uid: 503,
    npm error   gid: 20,
    npm error   rdev: 0,
    npm error   blksize: 4096,
    npm error   ino: 14319634,
    npm error   size: 293,
    npm error   blocks: 8,
    npm error   atimeMs: 1724969409000,
    npm error   mtimeMs: 1724969409000,
    npm error   ctimeMs: 1724969409821.8218,
    npm error   birthtimeMs: 1724969409000
    npm error }
    npm error In file included from ../node-expat.cc:1:
    npm error In file included from ../../nan/nan.h:62:
    npm error In file included from /Users/amitpari/.electron-gyp/32.0.1/include/node/node.h:79:
    npm error In file included from /Users/amitpari/.electron-gyp/32.0.1/include/node/v8.h:23:
    npm error In file included from /Users/amitpari/.electron-gyp/32.0.1/include/node/cppgc/common.h:8:
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8config.h:13:2: error: "C++20 or later required."
    npm error #error "C++20 or later required."
    npm error  ^
    npm error In file included from ../node-expat.cc:1:
    npm error ../../nan/nan.h:700:39: error: no member named 'IdleNotificationDeadline' in 'v8::Isolate'
    npm error     return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
    npm error            ~~~~~~~~~~~~~~~~~~~~~~~~~  ^
    npm error ../../nan/nan.h:2560:8: error: no member named 'SetAccessor' in 'v8::ObjectTemplate'
    npm error   tpl->SetAccessor(
    npm error   ~~~~~^
    npm error ../../nan/nan.h:2608:8: error: no member named 'SetAccessor' in 'v8::ObjectTemplate'
    npm error   tpl->SetAccessor(
    npm error   ~~~~~^
    npm error ../../nan/nan.h:2654:15: error: no member named 'SetAccessor' in 'v8::Object'
    npm error   return obj->SetAccessor(
    npm error          ~~~~~^
    npm error ../../nan/nan.h:2730:19: error: no matching constructor for initialization of 'v8::NamedPropertyHandlerConfiguration'
    npm error   tpl->SetHandler(v8::NamedPropertyHandlerConfiguration(
    npm error                   ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-template.h:772:12: note: candidate constructor not viable: no known conversion from 'imp::NativePropertyGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'NamedPropertyGetterCallback' (aka 'Intercepted (*)(Local<Name>, const PropertyCallbackInfo<Value> &)') for 1st argument
    npm error   explicit NamedPropertyHandlerConfiguration(
    npm error            ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-template.h:790:3: note: candidate constructor not viable: no known conversion from 'imp::NativePropertyGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'NamedPropertyGetterCallback' (aka 'Intercepted (*)(Local<Name>, const PropertyCallbackInfo<Value> &)') for 1st argument
    npm error   NamedPropertyHandlerConfiguration(
    npm error   ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-template.h:752:3: note: candidate constructor not viable: requires at least 7 arguments, but 6 were provided
    npm error   NamedPropertyHandlerConfiguration(
    npm error   ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-template.h:741:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 6 were provided
    npm error struct NamedPropertyHandlerConfiguration {
    npm error        ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-template.h:741:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 6 were provided
    npm error In file included from ../node-expat.cc:1:
    npm error ../../nan/nan.h:2800:19: error: no matching constructor for initialization of 'v8::IndexedPropertyHandlerConfiguration'
    npm error   tpl->SetHandler(v8::IndexedPropertyHandlerConfiguration(
    npm error                   ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-template.h:851:12: note: candidate constructor not viable: no known conversion from 'imp::NativeIndexGetter' (aka 'void (*)(unsigned int, const PropertyCallbackInfo<v8::Value> &)') to 'IndexedPropertyGetterCallbackV2' (aka 'v8::Intercepted (*)(unsigned int, const PropertyCallbackInfo<Value> &)') for 1st argument
    npm error   explicit IndexedPropertyHandlerConfiguration(
    npm error            ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-template.h:869:3: note: candidate constructor not viable: no known conversion from 'imp::NativeIndexGetter' (aka 'void (*)(unsigned int, const PropertyCallbackInfo<v8::Value> &)') to 'IndexedPropertyGetterCallbackV2' (aka 'v8::Intercepted (*)(unsigned int, const PropertyCallbackInfo<Value> &)') for 1st argument
    npm error   IndexedPropertyHandlerConfiguration(
    npm error   ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-template.h:831:3: note: candidate constructor not viable: requires at least 7 arguments, but 6 were provided
    npm error   IndexedPropertyHandlerConfiguration(
    npm error   ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-template.h:820:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 6 were provided
    npm error struct IndexedPropertyHandlerConfiguration {
    npm error        ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-template.h:820:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 6 were provided
    npm error In file included from ../node-expat.cc:1:
    npm error In file included from ../../nan/nan.h:2966:
    npm error ../../nan/nan_scriptorigin.h:19:7: error: no matching constructor for initialization of 'v8::ScriptOrigin'
    npm error       v8::ScriptOrigin(v8::Isolate::GetCurrent(), name) {}
    npm error       ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-message.h:64:13: note: candidate constructor not viable: no known conversion from 'Isolate *' to 'Local<Value>' for 1st argument
    npm error   V8_INLINE ScriptOrigin(Local<Value> resource_name,
    npm error             ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
    npm error class V8_EXPORT ScriptOrigin {
    npm error                 ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
    npm error In file included from ../node-expat.cc:1:
    npm error In file included from ../../nan/nan.h:2966:
    npm error ../../nan/nan_scriptorigin.h:23:7: error: no matching constructor for initialization of 'v8::ScriptOrigin'
    npm error       v8::ScriptOrigin(v8::Isolate::GetCurrent()
    npm error       ^                ~~~~~~~~~~~~~~~~~~~~~~~~~
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-message.h:64:13: note: candidate constructor not viable: no known conversion from 'Isolate *' to 'Local<Value>' for 1st argument
    npm error   V8_INLINE ScriptOrigin(Local<Value> resource_name,
    npm error             ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3 were provided
    npm error class V8_EXPORT ScriptOrigin {
    npm error                 ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 3 were provided
    npm error In file included from ../node-expat.cc:1:
    npm error In file included from ../../nan/nan.h:2966:
    npm error ../../nan/nan_scriptorigin.h:30:7: error: no matching constructor for initialization of 'v8::ScriptOrigin'
    npm error       v8::ScriptOrigin(v8::Isolate::GetCurrent()
    npm error       ^                ~~~~~~~~~~~~~~~~~~~~~~~~~
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-message.h:64:13: note: candidate constructor not viable: no known conversion from 'Isolate *' to 'Local<Value>' for 1st argument
    npm error   V8_INLINE ScriptOrigin(Local<Value> resource_name,
    npm error             ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 4 were provided
    npm error class V8_EXPORT ScriptOrigin {
    npm error                 ^
    npm error /Users/amitpari/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 4 were provided
    npm error 10 errors generated.
    npm error make: *** [Release/obj.target/node_expat/node-expat.o] Error 1
    npm error gyp ERR! build error 
    npm error gyp ERR! stack Error: `make` failed with exit code: 2
    npm error gyp ERR! stack at ChildProcess.<anonymous> (/Volumes/workplace/EPIManualMappingTool/node_modules/node-gyp/lib/build.js:216:23)
    npm error gyp ERR! System Darwin 23.6.0
    npm error gyp ERR! command "/Volumes/workplace/EPIManualMappingTool/node_modules/node/bin/node" "/Volumes/workplace/EPIManualMappingTool/node_modules/.bin/node-gyp" "rebuild"
    npm error gyp ERR! cwd /Volumes/workplace/EPIManualMappingTool/node_modules/node-expat
    npm error gyp ERR! node -v v22.7.0
    npm error gyp ERR! node-gyp -v v10.2.0
    npm error gyp ERR! not ok
    npm error A complete log of this run can be found in: /Users/amitpari/.npm/_logs/2024-08-29T22_10_06_875Z-debug-0.log
    
                    command=/Users/amitpari/.nvm/versions/node/v20.16.0/bin/node /Users/amitpari/.nvm/versions/node/v20.16.0/lib/node_modules/npm/bin/npm-cli.js rebuild [email protected] [email protected]
                    workingDir=
npm error code 1
npm error path /Volumes/workplace/EPIManualMappingTool
npm error command failed
npm error command sh -c node license-validator.js && electron-builder install-app-deps
npm error A complete log of this run can be found in: /Users/amitpari/.npm/_logs/2024-08-29T22_09_40_053Z-debug-0.log

Actual Behavior

npm install shouldn't fail after upgrading electron.

Testcase Gist URL

No response

Additional Information

Here is my package.json file with all the dependencies

{
  "name": "abc",
  "version": "6.4.27",
  "description": "abc",
  "productName": "abc",
  "main": "./dist/main.js",
  "scripts": {
    "build-scss": "sass css/scss:css/scss",
    "watch-scss": "sass -w css/scss:css/scss",
    "build-ts": "tsc",
    "watch-ts": "tsc -w",
    "build": "npm run build-scss && npm run build-ts",
    "watch": "npm run watch-scss & npm run watch-ts",
    "lint": "tslint -c tslint.json -p tsconfig.json",
    "start": "npm run test && electron ./dist/main.js",
    "packageWin32": "npm run test && electron-packager . --overwrite --platform=win32 --arch=x64 --prune=true --out=release-builds --target=portable",
    "packageMac": "npm run test && electron-packager . --overwrite --platform=darwin --arch=x64 --prune=true --out=release-builds",
    "winstaller": "npm run test && electron-builder -w --x64 --publish always",
    "macinstaller": "npm run test && electron-builder -m --publish always",
    "publish": "npm run test && electron-builder --publish always",
    "postinstall": "node license-validator.js && electron-builder install-app-deps",
    "release": "npm run test && node release.js",
    "test": "npm run build && jest"
  },
  "build": {
    "appId": "com.electron.abc",
    "mac": {
      "category": "com.electron.abc",
      "target": "dmg"
    },
    "win": {
      "target": "nsis",
      "icon": "resources/atom.ico"
    },
    "directories": {
      "app": "./",
      "output": "build"
    },
    "publish": [
      {
        "provider": "generic",
        "url": "https://abc/abc/releases"
      }
    ],
    "files": [
      "dist/**/*",
      "layouts/**/*",
      "node_modules/**/*",
      "css/**/*",
      "src/**/*.js",
      "src/**/*.css",
      "images/*.png"
    ]
  },
  "repository": "https://abc/packages/abc",
  "author": "abc",
  "devDependencies": {
    "@jest/globals": "^29.7.0",
    "@types/codemirror": "5.60.15",
    "@types/electron-store": "^3.2.0",
    "@types/jest": "^29.5.12",
    "@types/jquery": "^3.5.30",
    "@types/node": "^22.5.1",
    "@types/systeminformation": "^3.54.1",
    "aws-sdk": "^2.1686.0",
    "bytes": "^3.1.2",
    "chokidar": "^3.6.0",
    "electron": "^32.0.1",
    "electron-builder": "^24.13.3",
    "electron-builder-squirrel-windows": "^25.0.5",
    "electron-packager": "^17.1.2",
    "electron-reload": "^1.5.0",
    "fsevents": "^2.3.3",
    "glob-watcher": "^6.0.0",
    "jest": "^29.7.0",
    "js-yaml": "^4.1.0",
    "nan": "^2.20.0",
    "node-expat": "^2.4.1",
    "node-license-validator": "^1.3.2",
    "require-main-filename": "^2.0.0",
    "spectron": "^19.0.0",
    "ts-jest": "^29.2.5",
    "tslint": "^6.1.3",
    "typescript": "^5.5.4",
    "typings": "^2.1.1"
  },
  "dependencies": {
    "@electron/remote": "^2.1.2",
    "angular": "^1.8.3",
    "base64-js": "^1.5.1",
    "chrome-tabs": "^5.4.0",
    "codemirror": "^6.0.1",
    "convert-units": "^2.3.4",
    "crypto-js": "^4.2.0",
    "dexie": "^4.0.8",
    "dom-parser": "^1.1.5",
    "electron-prompt": "^1.7.0",
    "electron-store": "^10.0.0",
    "electron-updater": "^6.2.1",
    "file-stream-rotator": "^1.0.0",
    "file-url": "^4.0.0",
    "fomantic-ui": "^2.9.3",
    "font-awesome": "^4.7.0",
    "himalaya": "^1.1.0",
    "htmlparser2": "^9.1.0",
    "install-changed": "^1.1.0",
    "jquery": "^3.7.1",
    "jquery-ui-dist": "^1.13.3",
    "log4javascript": "^1.4.16",
    "mark.js": "^8.11.1",
    "moment": "^2.30.1",
    "node": "^22.7.0",
    "node-cache": "^5.1.2",
    "node-gyp": "^10.2.0",
    "package.json": "^2.0.1",
    "pako": "^2.1.0",
    "parse-domain": "^8.2.2",
    "request": "^2.88.2",
    "request-promise": "^4.2.6",
    "require-main-filename": "^2.0.0",
    "sass": "^1.77.8",
    "semantic-ui-calendar": "0.0.8",
    "sweetalert2": "^11.12.4",
    "symbol-tree": "^3.2.4",
    "systeminformation": "^5.23.5",
    "ts-enum-util": "^4.1.0",
    "tsv": "^0.2.0",
    "xml2js": "^0.6.2",
    "xml2json": "^0.12.0",
    "xmldom": "^0.6.0"
  }
}
@amitparida amitparida changed the title [Bug]: npm install failing after electron upgrade to v32.0.0 and v32.0.1 [Bug]: npm install failing post electron upgrade to v32.0.0 and v32.0.1 Aug 29, 2024
@github-project-automation github-project-automation bot moved this to 👀 Unsorted Items in 32-x-y Aug 29, 2024
@amitparida amitparida changed the title [Bug]: npm install failing post electron upgrade to v32.0.0 and v32.0.1 [Bug]: electron-builder install-app-deps failing post electron upgrade to v32.0.0 and v32.0.1 Aug 30, 2024
@WesWeCan
Copy link

I feel like I bumped into this bug as well. It seems to be something with the integration of node-gyp and the V8 engine.

I tried to install pokusew/nfc-pcsc which down the line relies on pcsclite.

All issues disappear when downgrading to electron 31...

› (node:55866) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
  (Use `node --trace-deprecation ...` to show where the warning was created)
  CXX(target) Release/obj.target/pcsclite/src/addon.o
  In file included from ../src/addon.cpp:1:
  In file included from ../src/pcsclite.h:4:
  In file included from ../../../nan/nan.h:62:
  In file included from /Users/weswecan/.electron-gyp/32.0.1/include/node/node.h:79:
  In file included from /Users/weswecan/.electron-gyp/32.0.1/include/node/v8.h:23:
  In file included from /Users/weswecan/.electron-gyp/32.0.1/include/node/cppgc/common.h:8:
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8config.h:13:2: error: "C++20 or later required."
  #error "C++20 or later required."
  ^
  In file included from ../src/addon.cpp:1:
  In file included from ../src/pcsclite.h:4:
  ../../../nan/nan.h:700:39: error: no member named 'IdleNotificationDeadline' in 'v8::Isolate'
  return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
  ~~~~~~~~~~~~~~~~~~~~~~~~~  ^
  ../../../nan/nan.h:2560:8: error: no member named 'SetAccessor' in 'v8::ObjectTemplate'
  tpl->SetAccessor(
  ~~~~~^
  ../../../nan/nan.h:2608:8: error: no member named 'SetAccessor' in 'v8::ObjectTemplate'
  tpl->SetAccessor(
  ~~~~~^
  ../../../nan/nan.h:2654:15: error: no member named 'SetAccessor' in 'v8::Object'
  return obj->SetAccessor(
  ~~~~~^
  ../../../nan/nan.h:2730:19: error: no matching constructor for initialization of 'v8::NamedPropertyHandlerConfiguration'
  tpl->SetHandler(v8::NamedPropertyHandlerConfiguration(
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-template.h:772:12: note: candidate constructor not viable: no known conversion from 'imp::NativePropertyGetter' (aka
  'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'NamedPropertyGetterCallback' (aka 'Intercepted (*)(Local<Name>, const
  PropertyCallbackInfo<Value> &)') for 1st argument
  explicit NamedPropertyHandlerConfiguration(
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-template.h:790:3: note: candidate constructor not viable: no known conversion from 'imp::NativePropertyGetter' (aka
  'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'NamedPropertyGetterCallback' (aka 'Intercepted (*)(Local<Name>, const
  PropertyCallbackInfo<Value> &)') for 1st argument
  NamedPropertyHandlerConfiguration(
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-template.h:752:3: note: candidate constructor not viable: requires at least 7 arguments, but 6 were provided
  NamedPropertyHandlerConfiguration(
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-template.h:741:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 6
  were provided
  struct NamedPropertyHandlerConfiguration {
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-template.h:741:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 6
  were provided
  In file included from ../src/addon.cpp:1:
  In file included from ../src/pcsclite.h:4:
  ../../../nan/nan.h:2800:19: error: no matching constructor for initialization of 'v8::IndexedPropertyHandlerConfiguration'
  tpl->SetHandler(v8::IndexedPropertyHandlerConfiguration(
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-template.h:851:12: note: candidate constructor not viable: no known conversion from 'imp::NativeIndexGetter' (aka
  'void (*)(unsigned int, const PropertyCallbackInfo<v8::Value> &)') to 'IndexedPropertyGetterCallbackV2' (aka 'v8::Intercepted (*)(unsigned int, const
  PropertyCallbackInfo<Value> &)') for 1st argument
  explicit IndexedPropertyHandlerConfiguration(
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-template.h:869:3: note: candidate constructor not viable: no known conversion from 'imp::NativeIndexGetter' (aka 'void
  (*)(unsigned int, const PropertyCallbackInfo<v8::Value> &)') to 'IndexedPropertyGetterCallbackV2' (aka 'v8::Intercepted (*)(unsigned int, const PropertyCallbackInfo<Value>
  &)') for 1st argument
  IndexedPropertyHandlerConfiguration(
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-template.h:831:3: note: candidate constructor not viable: requires at least 7 arguments, but 6 were provided
  IndexedPropertyHandlerConfiguration(
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-template.h:820:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 6
  were provided
  struct IndexedPropertyHandlerConfiguration {
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-template.h:820:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 6
  were provided
  In file included from ../src/addon.cpp:1:
  In file included from ../src/pcsclite.h:4:
  In file included from ../../../nan/nan.h:2966:
  ../../../nan/nan_scriptorigin.h:19:7: error: no matching constructor for initialization of 'v8::ScriptOrigin'
  v8::ScriptOrigin(v8::Isolate::GetCurrent(), name) {}
  ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-message.h:64:13: note: candidate constructor not viable: no known conversion from 'Isolate *' to 'Local<Value>' for
  1st argument
  V8_INLINE ScriptOrigin(Local<Value> resource_name,
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2
  were provided
  class V8_EXPORT ScriptOrigin {
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2
  were provided
  In file included from ../src/addon.cpp:1:
  In file included from ../src/pcsclite.h:4:
  In file included from ../../../nan/nan.h:2966:
  ../../../nan/nan_scriptorigin.h:23:7: error: no matching constructor for initialization of 'v8::ScriptOrigin'
  v8::ScriptOrigin(v8::Isolate::GetCurrent()
  ^                ~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-message.h:64:13: note: candidate constructor not viable: no known conversion from 'Isolate *' to 'Local<Value>' for
  1st argument
  V8_INLINE ScriptOrigin(Local<Value> resource_name,
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3
  were provided
  class V8_EXPORT ScriptOrigin {
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 3
  were provided
  In file included from ../src/addon.cpp:1:
  In file included from ../src/pcsclite.h:4:
  In file included from ../../../nan/nan.h:2966:
  ../../../nan/nan_scriptorigin.h:30:7: error: no matching constructor for initialization of 'v8::ScriptOrigin'
  v8::ScriptOrigin(v8::Isolate::GetCurrent()
  ^                ~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-message.h:64:13: note: candidate constructor not viable: no known conversion from 'Isolate *' to 'Local<Value>' for
  1st argument
  V8_INLINE ScriptOrigin(Local<Value> resource_name,
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 4
  were provided
  class V8_EXPORT ScriptOrigin {
  ^
  /Users/weswecan/.electron-gyp/32.0.1/include/node/v8-message.h:62:17: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 4
  were provided
  10 errors generated.
  make: *** [Release/obj.target/pcsclite/src/addon.o] Error 1
  Error: `make` failed with exit code: 2
  at ChildProcess.onExit (/Users/weswecan/Development/GitHub/dcentre-engaging-encounters/node_modules/node-gyp/lib/build.js:203:23)
  at ChildProcess.emit (node:events:520:28)
  at ChildProcess._handle.onexit (node

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

An unhandled rejection has occurred inside Forge:
Error: node-gyp failed to rebuild '/Users/weswecan/Development/GitHub/dcentre-engaging-encounters/node_modules/@pokusew/pcsclite'
at ChildProcess.<anonymous> (/Users/weswecan/Development/GitHub/dcentre-engaging-encounters/node_modules/@electron/rebuild/lib/module-type/node-gyp/node-gyp.js:118:24)
    at ChildProcess.emit (node:events:520:28)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12)
error Command failed with exit code 1.

@amitparida
Copy link
Author

amitparida commented Sep 3, 2024

Hello Team,
Would it be possible to receive an update? Our in-production tools are impacted.

@codebytere
Copy link
Member

The Electron core team is not responsible for electron-builder - please open the issue on that repo.

@codebytere codebytere closed this as not planned Won't fix, can't repro, duplicate, stale Sep 4, 2024
@mlaurencin mlaurencin removed this from 32-x-y Sep 4, 2024
@iongion
Copy link

iongion commented Sep 5, 2024

The Electron core team is not responsible for electron-builder - please open the issue on that repo.

But this is not electron-builder related - Since upgrading to electron 32.x, I get these on all platforms (windows/mac/linux)

npm install --save electron
npm run electron-rebuild

The on all OSs, I get this:

⠹ Building module: cpu-features, Completed: 0
  impl_aarch64_linux_or_android.c
  impl_aarch64_macos_or_iphone.c
  impl_aarch64_windows.c
  impl_arm_linux_or_android.c
  impl_mips_linux_or_android.c
  impl_ppc_linux.c
  impl_x86_freebsd.c
  impl_x86_linux_or_android.c
  impl_x86_macos.c
  impl_x86_windows.c
  filesystem.c
  stack_line_reader.c
  string_view.c
  win_delay_load_hook.cc
  binding.cc
.electron-gyp\32.0.2\include\node\v8config.h(13,1): error C1189: #error:  "C++20 or later required."

Downgrading to 31.x fixes the above issues

@amitparida
Copy link
Author

Hi Team,

The issue is not related to electron-builder but has a lot to do with the upgraded electron version 32.x.y. Please support us in resolving the issue.

PS: Please don't close the issue, without addressing our problems.

Regards,
Amit

@amitparida
Copy link
Author

Related issue posted here: WiseLibs/better-sqlite3#1225

@automationghost
Copy link

So it this a electron builder problem or what ? i cant built duo this error. Im now unsure if electron version is at fault or if electron builder needs an update ? anyway guess I will have to fallback to 31 for now

C++20 or later required."
13 | #error "C++20 or later required.

@boan-anbo
Copy link

Same issue: also MacOS, encountered this with electron-forge on v32. Downgrading to Electron v31 works.

@mmaietta
Copy link

Chiming in here from the electron-builder side. Can you test on latest/next v25.x? (if not having done so already)
Electron-builder officially migrated to electron/rebuild package in v25 to handle rebuilding native dependencies

@nosferatu500
Copy link

I'm on latest 32.x electron and latest 25.x electron-builder, same issue.

@icebob
Copy link

icebob commented Sep 26, 2024

Same issue. The native module rebuild works with Electron 31, but C++20 error with Electron 32

@danielweck
Copy link

Solution: migrate from NAN to NAPI, or if you must use NAN then simply patch nan.h to disable the broken code (which is what I originally did) or even easier, use the code from @toshiyuki-rs 's fork to patch the official NAN release installed NPM, during postinstall. See:

nodejs/nan#973 (comment)

@icebob
Copy link

icebob commented Sep 26, 2024

@danielweck thanks for your answer but as I see the given library has already been using NAPI, right?

image

@danielweck
Copy link

The OP's stacktrace shows NAN references, which fail to compile.

NAPI works out of the box, in my Electron v32 project :)

Frankly the effort of migrating from NAN to NAPI is well worth it, if anything for the ABI portability advantages (i.e. no need for strict version match that otherwise require a complete rebuild against the exact runtime revision), but also because it is the recommended modern method to build NodeJS / Electron native add-ons, using a well-maintained abstraction library (unlike NAN which seems to accumulate technical debt more often).

@dubdia
Copy link

dubdia commented Oct 13, 2024

I have the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

12 participants