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

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

> manual-mapping-tool@6.4.27 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  dependencies=node-expat@2.4.1, fsevents@1.2.13 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 node-gyp@10.2.0
    npm error gyp info using node@22.7.0 | darwin | arm64
    npm error gyp info find Python using Python version 3.12.5 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
    npm error gyp info spawn /opt/homebrew/opt/python@3.12/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 node-expat@2.4.1 fsevents@1.2.13
                    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"
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (1 by maintainers)

Most upvoted comments

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

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

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