electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.62k stars 1.74k forks source link

npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1 #6812

Closed albakhtari closed 2 years ago

albakhtari commented 2 years ago

I get this error on my 5.15.28-1-MANJARO system.

This is the output of npm i:

This is the output of `npm i`: ```bash >>> npm i > walc@0.2.1 postinstall > electron-builder install-app-deps • electron-builder version=22.14.13 • loaded configuration file=package.json ("build" field) • rebuilding native dependencies dependencies=bcrypt@5.0.1, deasync@0.1.26, node-sass@7.0.1, usocket@0.3.0 platform=linux arch=x64 ⨯ cannot execute cause=exit status 1 errorOut=npm ERR! code 1 npm ERR! path /home/vm/WALC/node_modules/usocket npm ERR! command failed npm ERR! command sh -c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@7.1.2 npm ERR! gyp info using node@17.8.0 | linux | x64 npm ERR! gyp info find Python using Python version 3.10.2 found at "/usr/bin/python3" npm ERR! (node:18231) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only. npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created) npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/home/vm/WALC/node_modules/usocket/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/vm/WALC/node_modules/usocket/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/vm/WALC/node_modules/usocket/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/vm/.electron-gyp/17.4.1/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/home/vm/.electron-gyp/17.4.1', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/vm/WALC/node_modules/usocket/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/home/vm/.electron-gyp/17.4.1/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/vm/WALC/node_modules/usocket', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/home/vm/WALC/node_modules/usocket/node_modules/node-gyp/lib/configure.js:351:16) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System Linux 5.15.28-1-MANJARO npm ERR! gyp ERR! command "/usr/bin/node" "/home/vm/WALC/node_modules/usocket/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /home/vm/WALC/node_modules/usocket npm ERR! gyp ERR! node -v v17.8.0 npm ERR! gyp ERR! node-gyp -v v7.1.2 npm ERR! gyp ERR! not ok npm ERR! A complete log of this run can be found in: npm ERR! /home/vm/.npm/_logs/2022-04-23T18_30_28_316Z-debug-0.log command=/usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js rebuild bcrypt@5.0.1 deasync@0.1.26 node-sass@7.0.1 usocket@0.3.0 workingDir= npm ERR! code 1 npm ERR! path /home/vm/WALC npm ERR! command failed npm ERR! command sh -c electron-builder install-app-deps npm ERR! A complete log of this run can be found in: npm ERR! /home/vm/.npm/_logs/2022-04-23T18_30_23_391Z-debug-0.log ```
These are the contents of `package.json`: ```json { "name": "walc", "version": "0.2.1", "description": "A WhatsApp Desktop client for linux systems. This is an unofficial client. Use https://web.whatsapp.com for official web client as official desktop client for linux does not exist.", "main": "src/main.js", "scripts": { "start": "electron .", "clean": "rm -rf dist && rm -rf public/js/*", "dist": "npm run clean && npm run prod && npm run rebuild-deps && npm run build", "build": "electron-builder", "rebuild-deps": "electron-rebuild", "dev": "npm run development", "postinstall": "electron-builder install-app-deps", "development": "mix", "watch": "mix watch", "watch-poll": "mix watch -- --watch-options-poll=1000", "hot": "mix watch --hot", "prod": "npm run production", "production": "mix --production" }, "bin": { "walc": "main.js" }, "repository": { "type": "git", "url": "https://github.com/WAClient/WALC.git" }, "keywords": [ "whatsapp", "whatsapp-linux", "whatsapp-web" ], "author": "cstayyab (https://cstayyab.com)", "license": "GPL-3.0-or-later", "bugs": { "url": "https://github.com/cstayyab/WALC/issues" }, "build": { "appId": "com.cstayyab.linux.unofficial.whatsapp", "npmRebuild": false, "productName": "WALC", "files": [ "!dist", "!release-builds" ], "linux": { "category": "Social", "description": "An unofficial WhatsApp Desktop client for Linux. For official client use https://web.whatsapp.com as the official desktop client for Linux is not available.", "target": [ "AppImage" ], "icon": "src/icons/logo360x360.png", "synopsis": "WALC - unoffficial WhatsApp Linux Client", "publish": { "provider": "github", "owner": "WAClient", "host": "github.com" } } }, "devDependencies": { "@mdi/js": "^5.9.55", "deepmerge": "^4.2.2", "electron": "^17.4.0", "electron-builder": "^22.14.13", "electron-devtools-installer": "^3.2.0", "electron-rebuild": "^3.2.7", "laravel-mix": "^6.0.43", "postcss": "^8.4.12", "sass": "~1.32.13", "sass-loader": "^12.6.0", "vue": "^2.5.17", "vue-loader": "^15.9.8", "vue-template-compiler": "^2.6.12", "vuetify": "^2.6.4", "vuetify-loader": "^1.7.3", "vuetifyjs-mix-extension": "0.0.20", "webpack": "^5.72.0" }, "homepage": "https://cstayyab.com/projects/walc", "dependencies": { "axios": "^0.21.4", "bcrypt": "^5.0.1", "create-desktop-shortcuts": "^1.6.0", "dbus-next": "^0.10.2", "dot-prop": "^6.0.1", "electron-context-menu": "^3.1.2", "electron-store": "^8.0.1", "electron-updater": "^4.6.5", "electron-window-state": "^5.0.3", "get-pixels": "^3.3.3", "get-port-sync": "^1.0.1", "is-online": "^9.0.1", "lsb-release": "^0.1.0", "mime": "^2.6.0", "node-sass": "^7.0.1", "puppeteer-core": "^13.5.2", "puppeteer-in-electron": "^3.0.5", "vue-router": "^3.5.3", "vuex": "^3.6.2", "whatsapp-web-electron.js": "^1.16.6-1" } } ```

I tried to reinstall nodejs, npm and node-gyp and deleting all related files in my home directory. But that made no difference.

mmaietta commented 2 years ago

I don't think it's an error explicitly with electron-builder. I see this in the error logs:

npm ERR! gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp

Quick search came back with: https://stackoverflow.com/questions/69882740/how-to-rebuild-epoll-package-in-electron One recommendation is to use Node 16 instead of 17

albakhtari commented 2 years ago

I don't think it's an error explicitly with electron-builder. I see this in the error logs:

npm ERR! gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp

Quick search came back with: https://stackoverflow.com/questions/69882740/how-to-rebuild-epoll-package-in-electron One recommendation is to use Node 16 instead of 17

You know you're not the first to suggest this, so I'll give it a go. Thanks for the reply.