SLG / lgtv2mqtt

34 stars 3 forks source link

Errors during build #5

Open OBoudreaux opened 10 months ago

OBoudreaux commented 10 months ago

I've been having trouble getting the service to start on a rooted webOS7.3.1. Starting over with a fresh repo and taking a closer look at some errors in the build have me looking there.

C:\...\webOS_TV_SDK\mqtt\lgtv2mqtt>package-and-install.bat
"Compiling service"
npm ERR! Missing script: "install"
npm ERR!
npm ERR! Did you mean this?
npm ERR!     npm uninstall # Remove a package
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in: C:\...\AppData\Local\npm-cache\_logs\2024-01-03T17_36_48_703Z-debug-0.log

npm-run in the app-service directory confirms that there is no install script. The earlier npm install step should have taken care of this anyway as far as I can tell. Moving on in the batch file...

> com.slg.lgtv2mqtt.service@1.0.0 build
> tsc

C:\...\webOS_TV_SDK\mqtt\lgtv2mqtt\tv-service\node_modules\typescript\lib\tsc.js:93
  for (let i = startIndex ?? 0; i < array.length; i++) {
                           ^

SyntaxError: Unexpected token ?
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\...\webOS_TV_SDK\mqtt\lgtv2mqtt\tv-service\node_modules\typescript\bin\tsc:2:1)
"Adding stuff"

Not sure what the problem is there...

> com.slg.lgtv2mqtt.service@1.0.0 postbuild-win
> copy "services.json" "dist/" && copy "package.json" "dist/package.json" && cd dist && npm install --omit=dev

The filename, directory name, or volume label syntax is incorrect.
        0 file(s) copied.

"Packaging"
Create com.slg.lgtv2mqtt_0.0.1_all.ipk to C:\...\webOS_TV_SDK\mqtt\lgtv2mqtt
Success
"Installing"
Installing package .\com.slg.lgtv2mqtt_0.0.1_all.ipk
Success

I just went ahead and did the last steps manually. The package is a little larger (8MB vs 7.3MB) but the service still fails.

Seeing this in the syslog


[ERR] wam.jsconsole ERROR [4015:4015:CONSOLE(1)] "com.slg.lgtv2mqtt \"start [object Object]\", source: file:///media/developer/apps/usr/palm/applications/com.slg.lgtv2mqtt/js/script.js (1)\n" {}
OBoudreaux commented 10 months ago

Works fine on Linux

Rembock commented 3 months ago

Had the same problems, did the following:

  1. Install the LTS version of Node.JS, this fixed the punycode module deprecated warnings for me
  2. cd tv-service
  3. npm install
  4. npm run build
  5. npm run postbuild-win
  6. cd ..
  7. ares-package tv-app/ tv-service/
  8. ares-install .\com.slg.lgtv2mqtt_0.0.1_all.ipk

I think you can also just edit the batch-script, all you have to do is remove the word 'run' on line 6