paymoapp / electron-shutdown-handler

Handle shutdown messages on windows in your electron app and delay system shutdown
MIT License
22 stars 8 forks source link

Dependency outdated for VS 2022. #6

Closed athenakia closed 5 months ago

athenakia commented 1 year ago

Error logs:

prebuild info begin Prebuild version 11.0.4
prebuild info build Preparing to prebuild @paymoapp/electron-shutdown-handler@1.0.15 for napi 6 on win32-x64 using node-gyp
prebuild info find Python using Python version 3.11.6 found at "C:\Users\xxx\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe"
prebuild ERR! find VS
prebuild ERR! find VS msvs_version not set from command line or npm config
prebuild ERR! find VS running in VS Command Prompt, installation path is:
prebuild ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
prebuild ERR! find VS - will only use this version
prebuild ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
prebuild ERR! find VS could not find a version of Visual Studio 2017 or newer to use
prebuild ERR! find VS looking for Visual Studio 2015
prebuild ERR! find VS - not found
prebuild ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
prebuild ERR! find VS
prebuild ERR! find VS
**************************************************************
prebuild ERR! find VS You need to install the latest version of Visual Studio
prebuild ERR! find VS including the "Desktop development with C++"
prebuild ERR! find VS For more information consult the documentation at:
prebuild ERR! find VS https://github.com/nodejs/node-gyp#on-windows
prebuild ERR! find VS 
**************************************************************                                                                              
prebuild ERR! find VS
prebuild ERR! configure error
prebuild ERR! stack Error: Could not find any Visual Studio installation to use
prebuild ERR! stack     at VisualStudioFinder.fail (C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
prebuild ERR! stack     at C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\find-visualstudio.js:74:16
prebuild ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
prebuild ERR! stack     at C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\find-visualstudio.js:70:14
prebuild ERR! stack     at C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\find-visualstudio.js:372:16
prebuild ERR! stack     at C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\util.js:54:7
prebuild ERR! stack     at C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\util.js:33:16
prebuild ERR! stack     at ChildProcess.exithandler (node:child_process:427:5)
prebuild ERR! stack     at ChildProcess.emit (node:events:514:28)
prebuild ERR! stack     at maybeClose (node:internal/child_process:1091:16)
prebuild ERR! not ok
prebuild ERR! build Error: Could not find any Visual Studio installation to use
prebuild ERR! build     at VisualStudioFinder.fail (C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
prebuild ERR! build     at C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\find-visualstudio.js:74:16
prebuild ERR! build     at VisualStudioFinder.findVisualStudio2013 (C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
prebuild ERR! build     at C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\find-visualstudio.js:70:14
prebuild ERR! build     at C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\find-visualstudio.js:372:16
prebuild ERR! build     at C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\util.js:54:7
prebuild ERR! build     at C:\Users\xxx\Desktop\electron-shutdown-handler\node_modules\prebuild\node_modules\node-gyp\lib\util.js:33:16
prebuild ERR! build     at ChildProcess.exithandler (node:child_process:427:5)
prebuild ERR! build     at ChildProcess.emit (node:events:514:28)
prebuild ERR! build     at maybeClose (node:internal/child_process:1091:16)
gergof commented 1 year ago

Hi. The version of prebuild in use uses a version of node-gyp that only supports visual studio up to 2019. Currently it's not possible to update prebuild to a newer version.

But please note that prebuild is only required if you want to create prebuilt binaries which are already provided at https://github.com/paymoapp/electron-shutdown-handler/releases.

You can execute npm run build:gyp inside the package folder to build the binary from source with an up-to-date version of node-gyp. Also if you install this lib as a dependency to an electron application, the prebuilt binaries should be downloaded automatically.

athenakia commented 12 months ago

I clone the repository and change version of every dependency to latest(including node-gyp), then it works well on my PC with VS 2022. Are there any potential problems and where it could be?

gergof commented 5 months ago

Hi, sorry for responding this late. Yes, the development builds will work. But prebuild (at least at that time) was using a really old version of node-gyp which only supported visual studio 2019. So you will only hit road blocks when you execute npm run prebuild