npm i failing with electron-builder installation and node version 14.21.X

19 Views Asked by At

My Application has electron and electron-builder packages. electron-builder installation within npm i step fails with below error. From logs it seems make step is failing. How to resolve this error? Is this version compatibility issue?

> electron-builder install-app-deps

  • electron-builder  version=23.6.0
  • loaded configuration  file=package.json ("build" field)
  • rebuilding native dependencies  [email protected] platform=linux arch=x64
  ⨯ cannot execute  cause=exit status 1
                    out=
    > [email protected] install /home/abc/bench/my/api/frontend/node_modules/cpu-features
    > node buildcheck.js > buildcheck.gypi && node-gyp rebuild

    make: Entering directory '/home/abc/bench/my/api/frontend/node_modules/cpu-features/build'
      CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o
      CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o
      CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o
      CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o
      CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o
      CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o
      CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o
      CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o
      CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o
      CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o
      CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o
      AR(target) Release/obj.target/deps/cpu_features/cpu_features.a
      COPY Release/cpu_features.a
      CXX(target) Release/obj.target/cpufeatures/src/binding.o
    make: Leaving directory '/home/abc/bench/my/api/frontend/node_modules/cpu-features/build'

                    errorOut=In file included from ../src/binding.cc:1:
    /home/abc/.electron-gyp/23.3.13/include/node/node.h:27:2: error: #error "It looks like you are building this native module without using the right config.gypi.  This normally means that you need to update electron-rebuild (>=3.2.8) or node-gyp (>=9.0.0) if you're building modules directly."
       27 | #error "It looks like you are building this native module without using the right config.gypi.  This normally means that you need to update electron-rebuild (>=3.2.8) or node-gyp (>=9.0.0) if you're building modules directly."
          |  ^~~~~
    In file included from /home/abc/.electron-gyp/23.3.13/include/node/v8-object.h:10,
                     from /home/abc/.electron-gyp/23.3.13/include/node/v8-array-buffer.h:13,
                     from /home/abc/.electron-gyp/23.3.13/include/node/v8.h:24,
                     from /home/abc/.electron-gyp/23.3.13/include/node/node.h:79,
                     from ../src/binding.cc:1:
    /home/abc/.electron-gyp/23.3.13/include/node/v8-persistent-handle.h:256:44: warning: ‘template<class T> struct v8::CopyablePersistentTraits’ is deprecated: Use v8::Global instead [-Wdeprecated-declarations]
      256 |   using CopyablePersistent = Persistent<T, CopyablePersistentTraits<T>>;
          |                                            ^~~~~~~~~~~~~~~~~~~~~~~~
    /home/abc/.electron-gyp/23.3.13/include/node/v8-persistent-handle.h:255:48: note: declared here
      255 | struct V8_DEPRECATED("Use v8::Global instead") CopyablePersistentTraits {
          |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ../src/binding.cc:3:
    ../../nan/nan.h:206:16: warning: ‘template<class T> struct v8::CopyablePersistentTraits’ is deprecated: Use v8::Global instead [-Wdeprecated-declarations]
      206 |     public v8::CopyablePersistentTraits<T> {};
          |                ^~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /home/abc/.electron-gyp/23.3.13/include/node/v8-object.h:10,
                     from /home/abc/.electron-gyp/23.3.13/include/node/v8-array-buffer.h:13,
                     from /home/abc/.electron-gyp/23.3.13/include/node/v8.h:24,
                     from /home/abc/.electron-gyp/23.3.13/include/node/node.h:79,
                     from ../src/binding.cc:1:
    /home/abc/.electron-gyp/23.3.13/include/node/v8-persistent-handle.h:255:48: note: declared here
      255 | struct V8_DEPRECATED("Use v8::Global instead") CopyablePersistentTraits {
          |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ../src/binding.cc:1:
    /home/abc/.electron-gyp/23.3.13/include/node/node.h:991:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
      991 |       (node::addon_register_func) (regfunc),                          \
          |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/abc/.electron-gyp/23.3.13/include/node/node.h:1025:3: note: in expansion of macro ‘NODE_MODULE_X’
     1025 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
          |   ^~~~~~~~~~~~~
    ../src/binding.cc:152:1: note: in expansion of macro ‘NODE_MODULE’
      152 | NODE_MODULE(cpufeatures, init)
          | ^~~~~~~~~~~
    make: *** [cpufeatures.target.mk:126: Release/obj.target/cpufeatures/src/binding.o] Error 1
    gyp ERR! build error
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/home/abc/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
    gyp ERR! System Linux 5.15.146.1-microsoft-standard-WSL2
    gyp ERR! command "/home/abc/.nvm/versions/node/v14.21.3/bin/node" "/home/abc/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/abc/bench/my/api/frontend/node_modules/cpu-features
    gyp ERR! node -v v14.21.3
    gyp ERR! node-gyp -v v5.1.1
    gyp ERR! not ok
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] install: `node buildcheck.js > buildcheck.gypi && node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/abc/.npm/_logs/2024-03-25T09_58_09_722Z-debug.log

                    command=/home/abc/.nvm/versions/node/v14.21.3/bin/node /home/abc/.nvm/versions/node/v14.21.3/lib/node_modules/npm/bin/npm-cli.js rebuild [email protected]
                    workingDir=
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `electron-builder install-app-deps`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/abc/.npm/_logs/2024-03-25T09_58_09_821Z-debug.log

My package.json has below dependencies:

"dependencies": {
    "@microsoft/applicationinsights-react-js": "^3.3.5",
    "@microsoft/applicationinsights-web": "^2.8.5",
    "@szhsin/react-menu": "^1.10.0",
    "@tanstack/react-query": "^4.0.10",
    "@tanstack/react-query-devtools": "^4.7.1",
    "@tanstack/react-virtual": "^3.0.0-beta.17",
    "@tiptap/core": "^2.1.12",
    "@tiptap/extension-color": "^2.0.3",
    "@tiptap/extension-font-family": "^2.0.3",
    "@tiptap/extension-placeholder": "^2.0.3",
    "@tiptap/extension-text-align": "^2.0.3",
    "@tiptap/extension-text-style": "^2.0.3",
    "@tiptap/extension-underline": "^2.0.3",
    "@tiptap/pm": "^2.0.3",
    "@tiptap/react": "^2.0.3",
    "@tiptap/starter-kit": "^2.0.3",
    "@types/react-color": "^3.0.6",
    "@types/use-persisted-state": "^0.3.1",
    "ag-grid-community": "^29.3.4",
    "ag-grid-react": "^29.3.4",
    "assert": "^2.1.0",
    "axios": "^0.21.4",
    "bootstrap": "^4.6.2",
    "btoa": "^1.2.1",
    "buffer": "^6.0.3",
    "cheerio": "^1.0.0-rc.12",
    "classnames": "^2.2.6",
    "clipboardy": "^2.3.0",
    "copy-image-clipboard": "^2.1.2",
    "cropperjs": "^1.5.12",
    "date-fns": "^2.25.0",
    "dexie": "^3.2.3",
    "dexie-encrypted": "^2.0.0",
    "dexie-react-hooks": "^1.1.3",
    "diff": "^5.0.0",
    "dockerode": "^3.3.5",
    "electron-reload": "^2.0.0-alpha.1",
    "electron-store": "^8.1.0",
    "file-saver": "^2.0.2",
    "html-to-image": "^1.11.11",
    "html2canvas": "^1.3.2",
    "hyperformula": "^2.4.0",
    "jquery": "^3.6.0",
    "json-diff": "^0.5.4",
    "jszip": "^3.10.1",
    "jwt-decode": "^3.1.2",
    "localforage": "^1.9.0",
    "lodash": "^4.17.21",
    "mobx": "^6.0.1",
    "mobx-keystone": "^0.47.0",
    "mobx-react-lite": "^3.0.0",
    "moment": "^2.29.4",
    "numeral": "^2.0.6",
    "pako": "^2.1.0",
    "papaparse": "^5.4.1",
    "query-string": "^6.13.7",
    "randomcolor": "^0.6.2",
    "react": "^18.2.0",
    "react-archer": "^4.2.3",
    "react-bootstrap": "^1.6.7",
    "react-bootstrap-icons": "^1.10.3",
    "react-circular-progressbar": "^2.1.0",
    "react-color": "^2.19.3",
    "react-date-range": "^1.4.0",
    "react-datepicker": "^4.15.0",
    "react-dnd": "^11.1.3",
    "react-dnd-html5-backend": "^11.1.3",
    "react-dom": "^18.2.0",
    "react-draggable": "^4.4.3",
    "react-dropzone": "^11.2.3",
    "react-error-boundary": "^4.0.11",
    "react-hotkeys": "^2.0.0",
    "react-hotkeys-hook": "^4.3.3",
    "react-icons": "^4.3.1",
    "react-infinite-scroll-component": "^6.0.0",
    "react-joyride": "^2.3.0",
    "react-loading-overlay": "^1.0.1",
    "react-markdown": "^8.0.5",
    "react-mentions": "^4.1.1",
    "react-moment": "^1.1.1",
    "react-outside-click-handler": "^1.3.0",
    "react-papaparse": "^3.8.0",
    "react-player": "^2.9.0",
    "react-rnd": "^10.3.7",
    "react-router-dom": "^5.3.4",
    "react-scripts": "^5.0.1",
    "react-scroll-sync": "^0.9.0",
    "react-select": "^5.7.0",
    "react-split": "^2.0.14",
    "react-to-print": "^2.14.7",
    "react-truncate": "^2.4.0",
    "react-use": "^15.3.4",
    "recharts": "^2.5.0",
    "reconnecting-websocket": "^4.4.0",
    "remark-breaks": "^3.0.2",
    "remark-gfm": "^3.0.1",
    "sass": "^1.45.1",
    "selenium-webdriver": "^4.0.0-alpha.8",
    "serialize-query-params": "^2.0.2",
    "stream": "0.0.2",
    "swagger-ui-react": "^3.52.5",
    "tls": "0.0.1",
    "tweetnacl": "^0.14.5",
    "use-persisted-state": "^0.3.3",
    "use-query-params": "^2.0.0-rc.1",
    "use-react-screenshot": "^3.0.0",
    "util": "^0.12.5",
    "uuid": "^8.3.2",
    "xlsx": "^0.18.5"
  }
0

There are 0 best solutions below