Moebits / Waifu2x-GUI

An app that upscales anime-styled images, gifs, videos, and pdfs with waifu2x.
Other
289 stars 13 forks source link

The AppImage needs a newer version of Node #23

Closed Reinachan closed 1 month ago

Reinachan commented 6 months ago

I currently can't run the AppImage as it spits out this error. This is from v0.5.0

A JavaScript error occurred in the main process
Uncaught Exception:
Error: Could not load the "sharp" module using the linux-x64 runtime
Possible solutions:
- Please upgrade Node.js:
    Found 16.17.1
    Requires ^18.17.0 || ^20.3.0 || >=21.0.0
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (/tmp/.mount_Waifu21rGk1j/resources/app.asar/node_modules/sharp/lib/sharp.js:114:9)
    at Module._compile (node:internal/modules/cjs/loader:1141:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1196:10)
    at Module.load (node:internal/modules/cjs/loader:1011:32)
    at Module._load (node:internal/modules/cjs/loader:846:12)
    at f._load (node:electron/js2c/asar_bundle:2:13377)
    at Module.require (node:internal/modules/cjs/loader:1035:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/tmp/.mount_Waifu21rGk1j/resources/app.asar/node_modules/sharp/lib/constructor.js:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1141:14)

I tried the previous version, 0.4.9, and it throws this error

A JavaScript error occurred in the main process
Uncaught Exception:
Error: Could not load the "sharp" module using the linux-x64 runtime
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
    yarn add sharp --ignore-engines
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=linux --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (/tmp/.mount_Waifu2uG1BLu/resources/app.asar/node_modules/sharp/lib/sharp.js:114:9)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
    at Module.load (node:internal/modules/cjs/loader:1098:32)
    at Module._load (node:internal/modules/cjs/loader:945:12)
    at c._load (node:electron/js2c/node_init:2:13672)
    at Module.require (node:internal/modules/cjs/loader:1122:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/tmp/.mount_Waifu2uG1BLu/resources/app.asar/node_modules/sharp/lib/constructor.js:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)

I tried yet another older version and it also failed. Didn't check the logs for that one.

While it shouldn't matter as AppImages aren't dependent on distro, I run Fedora Workstation 39. It's also not related to my system's Node version as I've got Node 20-something.

Moebits commented 6 months ago

Sharp is a problematic dependency that only seems to work in the os you build it in, but I don't want to install linux OS just to build this app.

You can build it from source and post the AppImage, I will replace the one of the latest version. Install Node.js >=21.0.0

git clone https://github.com/Tenpi/Waifu2x-GUI.git
cd waifu2x-gui
npm install
npm rebuild
npm run build
valr337 commented 6 months ago

Built from source and tested AppImage but error on startup. image

In the same folder, linuxunpacked/waifu2x-gui works though Screenshot_20240424_044750

AppImage: https://pixeldrain.com/u/3RAgRkZ1

Sidenote another error when using Anime4k as engine image

Was missing these steps from installation when i built from scratch package: pkg-config dependencies for canvas https://www.npmjs.com/package/canvas rm -r package-lock.json clear npm cache if installation is taking way too long npm cache clear --force
(optional if still not working) npm config set registry http://registry.npmjs.org/ --global

Moebits commented 6 months ago

Thanks, updated the AppImage.

The linux Anime4k I bundled might have problems, you can try to build that project from source and I can update the linux files. https://github.com/TianZerL/Anime4KCPP/wiki/Building#building-on-linux