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

prebuild-install failed with error once i'm upgrading electron 28 and node 20 #74

Open
vaibhav-zapbuild opened this issue Jan 3, 2024 · 5 comments

Comments

@vaibhav-zapbuild
Copy link

{
"name": "vaibhav",
"version": "1.0.9",
"description": "vaibhav app",
"productName": "vaibhav",
"main": "main.js",
"targetUrl": "",
"scripts": {
"start": "electron .",
"postinstall": "electron-builder install-app-deps",
"package-linux": "electron-packager . vaibhav --overwrite --platform=linux --arch=x64 --prune=false --out=release-builds",
"package-windows": "electron-packager . vaibhav --overwrite --platform=win32 --arch=x64 --prune=false --out=release-builds",
"deb64": "electron-installer-debian --src ./release-builds/vaibhav-linux-x64/ --dest ../installers/ --arch amd64"
},
"keywords": [
"demo"
],
"build": {
"npmRebuild": false,
"electron": "./node_modules/.bin/electron",
"win": {
"icon": "icon/vaibhav-Logo.png",
"target": [
{
"target": "nsis",
"arch": [
"x64",
"ia32"
]
}
]
},
"nsis": {
"oneClick": false,
"perMachine": true,
"include": "installer.nsh"
}
},
"author": "demo",
"license": "ISC",
"devDependencies": {
"electron": "^28.1.0",
"electron-builder": "^24.9.1",
"electron-packager": "^17.1.2",
"electron-rebuild": "^3.2.9"
},
"dependencies": {
"@woovi/node-printer": "^1.0.1",
"axios": "^1.6.3",
"electron-dl": "^3.2.1",
"electron-store": "^7.0.0",
"electron-updater": "5.0.0",
"knex": "^3.1.0",
"nedb": "^1.8.0",
"nedb-promises": "^6.2.3",
"node-abi": "^2.19.3",
"node-pre-gyp": "^0.15.0",
"node-thermal-printer": "^4.1.2",
"sqlite3": "^5.1.6"
}
}

@matcontardo
Copy link

Same for me in Linux, but in Windows works well after installing Windows SDK 10.0.22000

@Susheer
Copy link

Susheer commented Nov 30, 2024

Try this out! It resolves many common issues during version upgrades and is fully compatible with the latest Electron version. The library and APIs remain consistent since it’s a fork of the original project.

  • No dependencies on NAN or V8: Powered by an N-API addon for better compatibility and performance.
  • Platform Support: Currently supported on Windows only, but support for other platforms can be added via pull requests.

Electron Printer

@Marlonzao
Copy link

Marlonzao commented Jan 17, 2025

Try this out! It resolves many common issues during version upgrades and is fully compatible with the latest Electron version. The library and APIs remain consistent since it’s a fork of the original project.

  • No dependencies on NAN or V8: Powered by an N-API addon for better compatibility and performance.
  • Platform Support: Currently supported on Windows only, but support for other platforms can be added via pull requests.

Electron Printer

Hello @Susheer,

I recently tried your project and encountered a few issues I’d like to bring to your attention.

  1. I noticed that the latest release of the project is version 2.0.2, but the prebuilt binaries for this version are missing in the Releases tab on GitHub. Only binaries for version 2.0.1 are available.
  2. I’m unable to build my Electron project when using this package. Below is the log output for reference:

0.295 > node_modules/.bin/electron-builder --win --x64
0.295
0.571 • electron-builder version=22.14.13 os=6.8.0-51-generic
0.607 • loaded configuration file=package.json ("build" field)
0.764 • rebuilding native dependencies dependencies=@thesusheer/[email protected] platform=win32 arch=x64
2.543 ⨯ cannot execute cause=exit status 1
2.543 errorOut=npm warn using --force Recommended protections disabled.
2.543 npm error code 1
2.543 npm error path /project/node_modules/@thesusheer/electron-printer
2.543 npm error command failed
2.543 npm error command sh -c prebuild-install || node-gyp rebuild
2.543 npm error make: Entering directory '/project/node_modules/@thesusheer/electron-printer/build'
2.543 npm error CC(target) Release/obj.target/nothing/../../node-addon-api/nothing.o
2.543 npm error rm -f Release/obj.target/../../node-addon-api/nothing.a Release/obj.target/../../node-addon-api/nothing.a.ar-file-list; mkdir -p dirname Release/obj.target/../../node-addon-api/nothing.a
2.543 npm error ar crs Release/obj.target/../../node-addon-api/nothing.a @Release/obj.target/../../node-addon-api/nothing.a.ar-file-list
2.543 npm error COPY Release/nothing.a
2.543 npm error CXX(target) Release/obj.target/electron_printer/src/hello_world.o
2.543 npm error make: Leaving directory '/project/node_modules/@thesusheer/electron-printer/build'
2.543 npm error prebuild-install warn install No prebuilt binaries found (target=32.2.0 runtime=electron arch=x64 libc= platform=win32)
2.543 npm error gyp info it worked if it ends with ok
2.543 npm error gyp info using [email protected]
2.543 npm error gyp info using [email protected] | linux | x64
2.543 npm error gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
2.543 npm error gyp http GET https://electronjs.org/headers/v32.2.0/node-v32.2.0-headers.tar.gz
2.543 npm error gyp http 200 https://artifacts.electronjs.org/headers/v32.2.0/node-v32.2.0-headers.tar.gz?force_headers_dist=1
2.543 npm error gyp http GET https://electronjs.org/headers/v32.2.0/SHASUMS256.txt
2.543 npm error gyp http 200 https://artifacts.electronjs.org/headers/v32.2.0/SHASUMS256.txt?force_headers_dist=1
2.543 npm error gyp info spawn /usr/bin/python3
2.543 npm error gyp info spawn args [
2.543 npm error gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
2.543 npm error gyp info spawn args 'binding.gyp',
2.543 npm error gyp info spawn args '-f',
2.543 npm error gyp info spawn args 'make',
2.543 npm error gyp info spawn args '-I',
2.543 npm error gyp info spawn args '/project/node_modules/@thesusheer/electron-printer/build/config.gypi',
2.543 npm error gyp info spawn args '-I',
2.543 npm error gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
2.543 npm error gyp info spawn args '-I',
2.543 npm error gyp info spawn args '/root/.electron-gyp/32.2.0/include/node/common.gypi',
2.543 npm error gyp info spawn args '-Dlibrary=shared_library',
2.543 npm error gyp info spawn args '-Dvisibility=default',
2.543 npm error gyp info spawn args '-Dnode_root_dir=/root/.electron-gyp/32.2.0',
2.543 npm error gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
2.543 npm error gyp info spawn args '-Dnode_lib_file=/root/.electron-gyp/32.2.0/<(target_arch)/node.lib',
2.543 npm error gyp info spawn args '-Dmodule_root_dir=/project/node_modules/@thesusheer/electron-printer',
2.543 npm error gyp info spawn args '-Dnode_engine=v8',
2.543 npm error gyp info spawn args '--depth=.',
2.543 npm error gyp info spawn args '--no-parallel',
2.543 npm error gyp info spawn args '--generator-output',
2.543 npm error gyp info spawn args 'build',
2.543 npm error gyp info spawn args '-Goutput_dir=.'
2.543 npm error gyp info spawn args ]
2.543 npm error gyp info spawn make
2.543 npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
2.543 npm error g++: error: unrecognized command line option ‘-std=gnu++20’; did you mean ‘-std=gnu++2a’?
2.543 npm error make: *** [electron_printer.target.mk:125: Release/obj.target/electron_printer/src/hello_world.o] Error 1
2.543 npm error gyp ERR! build error
2.543 npm error gyp ERR! stack Error: make failed with exit code: 2
2.543 npm error gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
2.543 npm error gyp ERR! System Linux 6.8.0-51-generic
2.543 npm error gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2.543 npm error gyp ERR! cwd /project/node_modules/@thesusheer/electron-printer
2.543 npm error gyp ERR! node -v v20.15.1
2.543 npm error gyp ERR! node-gyp -v v10.1.0
2.543 npm error gyp ERR! not ok
2.543
2.543 npm error A complete log of this run can be found in: /root/.npm/_logs/2025-01-17T21_15_21_800Z-debug-0.log
2.543
2.543 command=/usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js rebuild @thesusheer/[email protected]
2.543 workingDir=

Additionally, I wanted to share that I find your focus on a NAPI-based implementation to be brilliant! I’d love to contribute to the project and support its development. However, I’d appreciate some guidance on how to get started.

Thank you for your time and effort on this project. Looking forward to your response.

Best regards,
Marlon.

@Susheer
Copy link

Susheer commented Jan 28, 2025 via email

@Alexssmusica
Copy link

There is this option too, it doesn't have all the APIs, but it works well

https://www.npmjs.com/package/printer-node-electron?activeTab=readme
https://github.com/Alexssmusica/printer-node-electron

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

5 participants