wow.export icon indicating copy to clipboard operation
wow.export copied to clipboard

linux-x64 "No available node version satisfies 'node22'"

Open knuxyl opened this issue 1 year ago • 3 comments

Build fails for linux-x64 with nodejs v22.4.1

[email protected] Error! No available node version satisfies 'node22'

Complete output (full paths removed from logs for readability) node ./build.js linux-x64

(node:489980) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) INFO Selected builds: linux-x64 INFO Starting build linux-x64 [guid ed2593bf-7a3d-44b9-bdc0-44e9c26b03c4]... INFO Extracting files from nwjs-v0.69.1-linux-x64.tar.gz... DONE Extracted 21 files (113 filtered) in 2.139s INFO Remapping files and merging additional sources... INFO wow.export/bin/linux-x64/nw -> wow.export/bin/linux-x64/wow.export INFO wow.export/bin/linux-x64/credits.html -> wow.export/bin/linux-x64/license/nwjs.html INFO wow.export/LEGAL -> wow.export/bin/linux-x64/license/LEGAL INFO wow.export/resources/icon.png -> wow.export/bin/linux-x64/res/icon.png INFO wow.export/src/lib/vue.min.js -> wow.export/bin/linux-x64/src/lib/vue.js INFO wow.export/src/lib/three.min.js -> wow.export/bin/linux-x64/src/lib/three.js INFO wow.export/addons/blender/2.80/io_scene_wowobj/init.py -> wow.export/bin/linux-x64/addon/io_scene_wowobj/init.py INFO wow.export/addons/blender/2.80/io_scene_wowobj/import_wowobj.py -> wow.export/bin/linux-x64/addon/io_scene_wowobj/import_wowobj.py INFO wow.export/addons/blender/2.80/io_scene_wowobj/README.txt -> wow.export/bin/linux-x64/addon/io_scene_wowobj/README.txt INFO Bundling sources (entry: wow.export/src/app.js)... DONE 101 sources bundled 786.15 KB -> 356.41 KB (55%) INFO Compiling stylesheet (entry: wow.export/src/app.scss)... DONE Compiled stylesheet (6 files) in 0.152s INFO Cloning sources wow.export/src -> wow.export/bin/linux-x64/src... DONE Cloned 158 source files in 0.011s INFO Compiling updater application (linux-x64)...

[email protected] Error! No available node version satisfies 'node22' ERR An unexpected error has halted the build: ERR Error: No available node version satisfies 'node22' at wasReported (wow.export/node_modules/pkg-fetch/lib-es5/log.js:128:13) at _callee$ (wow.export/node_modules/pkg-fetch/lib-es5/index.js:130:40) at tryCatch (wow.export/node_modules/regenerator-runtime/runtime.js:64:40) at Generator.invoke (wow.export/node_modules/regenerator-runtime/runtime.js:299:22) at Generator.next (wow.export/node_modules/regenerator-runtime/runtime.js:124:21) at asyncGeneratorStep (wow.export/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _next (wow.export/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9) at wow.export/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7 at new Promise () at wow.export/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12

System Information

uname -a

Linux arch-p340 6.9.9-hardened1-1-hardened #1 SMP PREEMPT_DYNAMIC Thu, 11 Jul 2024 20:14:26 +0000 x86_64 GNU/Linux

which node

/usr/bin/node

node --version

v22.4.1

neofetch

                  -`                    knuxyl@arch-p340 
                 .o+`                   ---------------- 
                `ooo/                   OS: Arch Linux x86_64 
               `+oooo:                  Host: 30DK000MUS ThinkStation P340 
              `+oooooo:                 Kernel: 6.9.9-hardened1-1-hardened 
              -+oooooo+:                Uptime: 1 day, 15 hours, 19 mins 
            `/:-:++oooo+:               Packages: 810 (pacman) 
           `/++++/+++++++:              Shell: bash 5.2.26 
          `/++++++++++++++:             Resolution: 2560x1440 
         `/+++ooooooooooooo/`           DE: GNOME 46.3.1 
        ./ooosssso++osssssso+`          WM: Mutter 
       .oossssso-````/ossssss+`         WM Theme: Adwaita 
      -osssssso.      :ssssssso.        Theme: Adwaita-dark [GTK2/3] 
     :osssssss/        osssso+++.       Icons: Adwaita [GTK2/3] 
    /ossssssss/        +ssssooo/-       Terminal: gnome-terminal 
  `/ossssso+/:-        -:/+osssso+-     CPU: Intel Xeon W-1290T (20) @ 4.700GHz 
 `+sso+:-`                 `.-/+oso:    GPU: AMD ATI Radeon Pro WX 4100 
`++:.                           `-/+/   GPU: Intel Comet Lake-S GT2 [UHD Graphics P630] 
.`                                 `/   Memory: 5453MiB / 64014MiB

knuxyl avatar Jul 15 '24 17:07 knuxyl

pkg has been deprecated: https://github.com/vercel/pkg

Smerdokryl avatar Jul 29 '24 07:07 Smerdokryl

I've tried node 18 through 23 and none work, surely if pkg is deprecated it should still work with older Node versions?

Rykita avatar Jan 04 '25 14:01 Rykita

So, I have figured it out, I swapped out the regular ol' pkg with https://github.com/yao-pkg/pkg then used Node 18 to build, the build completed

Rykita avatar Jan 04 '25 15:01 Rykita

Or you can update pkg to bring a newer version of pkg-fetch. You need to check which nodejs distributions pkg-fetch supports and use one of these when building.

On my end, I updated to the latest [email protected] which depends on [email protected]. Then I could use Node 18 without any issue.

Blockost avatar Mar 22 '25 21:03 Blockost

Hey I looked into this and it's a combination of wow.export being on ancient version of node 12 and using obsolete packages.

You can use this dockerfile (or just use the commands from it) to compile a Linux build.

FROM ubuntu:latest
ARG NODE_VERSION=22

# install dependencies including win64 for Windows builds
RUN apt update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install curl git wine64 wget -y

# install nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

# set env
ENV NVM_DIR=/root/.nvm

# install node
RUN bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"

# set ENTRYPOINT for reloading nvm-environment
ENTRYPOINT ["bash", "-c", "source $NVM_DIR/nvm.sh && exec \"$@\"", "--"]

# set cmd to bash
CMD ["/bin/bash"]

# Set work directory
WORKDIR /app

# Ubuntu doesn't add wine64 to PATH, needs to be added manually or Win64 builds fail
ENV PATH=$PATH:/usr/lib/wine

# Clone wow.export, nuke package-lock.json for ease of use and modify pkg version
RUN git clone https://github.com/Kruithne/wow.export.git && \
    rm -rf /app/wow.export/package-lock.json

# We need to bump minimum node version to 14 for Windows builds and bump the windows builds to min 14
# yao-pkg/pkg-fetch doesn't have node 12 builds, node too old!
RUN sed -i 's#"target": "win-x64-node12",#"target": "win-x64-node14",#' /app/wow.export/build.conf
RUN sed -i 's#"node": ">=12.12.0"#"node": ">=14.21.3"#' /app/wow.export/package.json

#Replace obsolete pkg version 4.4 with yao-pkg
RUN sed -i 's#"pkg": "^4.4.0",#"@yao-pkg/pkg": "^6.6.0",#' /app/wow.export/package.json
RUN sed -i 's#const pkg = require('"'"'pkg'"'"');#const pkg = require('"'"'@yao-pkg/pkg'"'"');#' /app/wow.export/build.js

# Build
RUN bash -c "source $NVM_DIR/nvm.sh && cd /app/wow.export && npm install && node ./build.js linux-x64 win-x64"

Then just pull the files from it by running it in the bg with docker run --rm -it wowexport-linuxbuild, get the container ID with docker ps and then just do docker cp <ContainerID>:/app/wow.export/bin/win-x64 .

thunderysteak avatar Aug 02 '25 01:08 thunderysteak

The build pipeline has been rewritten and you can now natively compile wow.export on Linux, complete with updater and all. We'll be providing official Linux builds from 0.1.66. :)

Kruithne avatar Aug 30 '25 14:08 Kruithne