reisxd / TizenTube

A NodeJS script to remove ads and add support for Sponsorblock for your Tizen TV (2017 and forward).
https://tizentube.live
GNU General Public License v3.0
389 stars 34 forks source link

Error running node . "Unexpected identifier" #41

Closed biejay closed 5 months ago

biejay commented 5 months ago

The Software is running on my android perfectly fine. But when I run it on an Ubuntu (LXC in Proxmox) I get this error when I Try to run "node ."

node .
file:///root/TizenTube/index.js:4
import Config from './config.json' assert { type: 'json' };
                                   ^^^^^^

SyntaxError: Unexpected identifier
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    at async link (internal/modules/esm/module_job.js:42:21)
biejay commented 5 months ago

I think it depends on another error when I run npm run build in the "mods" folder

My nodejs version:

node -v
v12.22.9

The error:

root@tizentube:~/TizenTube/mods# npm run build

> @tizentube/mods@1.0.0 build
> rollup -c rollup.config.js

internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module 'node:process'
Require stack:
- /root/TizenTube/mods/node_modules/rollup/dist/bin/rollup
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Module.<anonymous> (/root/TizenTube/mods/node_modules/rollup/dist/bin/rollup:15:19)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/root/TizenTube/mods/node_modules/rollup/dist/bin/rollup' ]
}
reisxd commented 5 months ago

You're using a version of Node that has been discontinued. Use the current LTS version.