quisquous/cactbot

Cactbot cannot be built in current 18.x NodeJS Version

jpdied opened this issue · 3 comments

jpdied commented

If you follow the current build instructions (the ones to build timelines, not the actual plugin), the build process faills and it looks like its due to recent newer versions of NodeJS.

Node.js v18.17.1

$ git clone git@github.com:quisquous/cactbot.git
Cloning into 'cactbot'...
remote: Enumerating objects: 83196, done.
remote: Counting objects: 100% (1014/1014), done.
remote: Compressing objects: 100% (407/407), done.
remote: Total 83196 (delta 677), reused 884 (delta 601), pack-reused 82182
Receiving objects: 100% (83196/83196), 104.10 MiB | 3.83 MiB/s, done.
Resolving deltas: 100% (62511/62511), done.

$ cd cactbot/

$ npm install

$ npm test

> cactbot@0.29.22 test
> mocha

(node:41700) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
N:\git\cactbot\node_modules\ttypescript\lib\loadTypescript.js:13
        function __() { this.constructor = d; }
                                         ^

TypeError: Cannot set property constructor of [object Object] which has only a getter
    at new __ (N:\git\cactbot\node_modules\ttypescript\lib\loadTypescript.js:13:42)
    at __extends (N:\git\cactbot\node_modules\ttypescript\lib\loadTypescript.js:14:84)
    at N:\git\cactbot\node_modules\ttypescript\lib\loadTypescript.js:65:5
    at Object.<anonymous> (N:\git\cactbot\node_modules\ttypescript\lib\loadTypescript.js:100:2)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:121:18)

Node.js v18.17.1

When performing the actions on a clean git install using version 18.12.0, things run correctly.

I think the documentation needs to be updated with version information, not just the NodeJS Version but any global packages. There's mention about installing typescript and ts-node globally in the CONTRIBUTING.md that would be helpful knowing which versions to install.

The 2nd priority would be working to update the code to work with the current NodeJS LTS release.

My suspicion is probably that we need a newer version of ttypescript.

i tried it on a vm i have (that has not the cleanest test env tbh) but i was able to build on node 18.17.1 after bumping up ttypescript to ^1.5.15

jpdied commented

That appears to have fixed it. I was able to update to NodeJS 18.17.1, bump the ttypescript and successfully compile/run.