cgdangelo / talent

GoldSrc demo parser written with fp-ts.
MIT License
10 stars 1 forks source link

Help with bringing up #147

Closed chinese-soup closed 1 year ago

chinese-soup commented 1 year ago

Hello. Hope you don't mind if I use the issue tracker to ask for help, I tried to message you on Discord, but you have your DMs closed.

First of all thanks again for creating the most complete documentation of Half-Life demos yet and for the parser!

I wanted to crosscheck some results using your code, however I am completely new to this Java/TypeScript 2010s+ ecosystem so I was wondering if you could give me a hint. I have done:

yarn install # in the root talent directory

This installed fine after I commented out a macOS-only dependency called fsevents (which I found out here: https://stackoverflow.com/questions/57082249/how-to-fix-error-fsevents2-0-7-the-platform-linux-is-incompatible-with-thi).

However, when I try to run the for example, the cli, this happens:

$ bin/talent ~/hl/valve/test.dem 
node:internal/modules/cjs/loader:998
  throw err;
  ^

Error: Cannot find module '../lib/index'
Require stack:
- /home/unko/repos/talent/packages/cli/bin/talent
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/home/unko/repos/talent/packages/cli/bin/talent:3:1)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/unko/repos/talent/packages/cli/bin/talent' ]
}

Node.js v19.0.0
┌──[unko@ryzen]─[~/repos/talent/packages/cli/bin] 
└──$ cat talent
#!/usr/bin/env node

require("../lib/index");
┌──[unko@ryzen]─[~/repos/talent/packages/cli/bin] 
└──$ /usr/bin/env node # just to check node is actually where it should be
Welcome to Node.js v19.0.0.
Type ".help" for more information.
> 

Which makes sense, seeing as I am apparently missing a lib directory?

┌──[unko@ryzen]─[~/repos/talent/packages/cli] 
└──$ find
.
./tsconfig.json
./package.json
./bin
./bin/talent
./src
./src/index.ts
./README.org
./jest.config.js
./test
./test/index.test.ts
./node_modules
./node_modules/@types
./node_modules/@types/node
./node_modules/@types/node/stream
./node_modules/@types/node/stream/promises.d.ts
./node_modules/@types/node/stream/web.d.ts
./node_modules/@types/node/stream/consumers.d.ts
./node_modules/@types/node/timers
./node_modules/@types/node/timers/promises.d.ts
./node_modules/@types/node/vm.d.ts
./node_modules/@types/node/buffer.d.ts
./node_modules/@types/node/readline.d.ts
./node_modules/@types/node/events.d.ts
./node_modules/@types/node/querystring.d.ts
./node_modules/@types/node/url.d.ts
./node_modules/@types/node/tty.d.ts
./node_modules/@types/node/dgram.d.ts
./node_modules/@types/node/v8.d.ts
./node_modules/@types/node/domain.d.ts
./node_modules/@types/node/fs
./node_modules/@types/node/fs/promises.d.ts
./node_modules/@types/node/os.d.ts
./node_modules/@types/node/process.d.ts
./node_modules/@types/node/https.d.ts
./node_modules/@types/node/http.d.ts
./node_modules/@types/node/dns
./node_modules/@types/node/dns/promises.d.ts
./node_modules/@types/node/fs.d.ts
./node_modules/@types/node/child_process.d.ts
./node_modules/@types/node/package.json
./node_modules/@types/node/net.d.ts
./node_modules/@types/node/repl.d.ts
./node_modules/@types/node/LICENSE
./node_modules/@types/node/console.d.ts
./node_modules/@types/node/perf_hooks.d.ts
./node_modules/@types/node/README.md
./node_modules/@types/node/http2.d.ts
./node_modules/@types/node/assert
./node_modules/@types/node/assert/strict.d.ts
./node_modules/@types/node/crypto.d.ts
./node_modules/@types/node/async_hooks.d.ts
./node_modules/@types/node/zlib.d.ts
./node_modules/@types/node/module.d.ts
./node_modules/@types/node/trace_events.d.ts
./node_modules/@types/node/timers.d.ts
./node_modules/@types/node/punycode.d.ts
./node_modules/@types/node/util.d.ts
./node_modules/@types/node/path.d.ts
./node_modules/@types/node/diagnostics_channel.d.ts
./node_modules/@types/node/dns.d.ts
./node_modules/@types/node/cluster.d.ts
./node_modules/@types/node/string_decoder.d.ts
./node_modules/@types/node/globals.global.d.ts
./node_modules/@types/node/index.d.ts
./node_modules/@types/node/globals.d.ts
./node_modules/@types/node/constants.d.ts
./node_modules/@types/node/stream.d.ts
./node_modules/@types/node/wasi.d.ts
./node_modules/@types/node/tls.d.ts
./node_modules/@types/node/worker_threads.d.ts
./node_modules/@types/node/assert.d.ts
./node_modules/@types/node/inspector.d.ts
./node_modules/.bin
./node_modules/.bin/talent

Again, sorry for misusing the issue tracker, but any pointers would be highly appreciated! :)

cgdangelo commented 1 year ago

No problem at all! Thanks for the kind words, too. 😄 I'll add you on Discord so we can chat further if you like.

I think you're just missing a build step to compile the TypeScript sources into JavaScript (and thus, into the lib directories for each package). You can fix this by running yarn build in the root directory, then you should be able to run with bin/talent ~/hl/valve/test.dem.

chinese-soup commented 1 year ago

I think you're just missing a build step to compile the TypeScript sources into JavaScript (and thus, into the lib directories for each package). You can fix this by running yarn build

Ah yes, looking back, now it's very obvious, lol, thank you for your help! Gonna close this, since it's not a real issue.)