4v3ngR / pluto_tv_scraper

Generate an m3u8 and xml (epg) for pluto tv channels
https://www.npmjs.com/package/plutotv-scraper
MIT License
21 stars 6 forks source link

Can't run on Debian Buster #12

Closed arcangelnew closed 10 months ago

arcangelnew commented 10 months ago

First of all, great little script, it works as it should, at least it does on windows, but I need it to run in my headless debain server that I use for all my media content.

So far I followed the installation steps as described but ran into some errors:

First I installed NPM and Node, debain installs the latest version for each:

$ npm -v
5.8.0
$ node -v
v10.24.0

Then when tried to install with npm install I get this error:

$ npm install
npm WARN npm npm does not support Node.js v10.24.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/

And when trying to run it anyway I get this:

$ node ./index.js
(node:7225) UnhandledPromiseRejectionWarning: Error: Cannot find module '#lib/utils.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at /srv/dev-disk-by-uuid-a4619db8-effc-41f3-b95e-7cb6cc26e81b/Iptv/pluto_tv/lib/plutotv/index.js:3:16
    at Object.<anonymous> (/srv/dev-disk-by-uuid-a4619db8-effc-41f3-b95e-7cb6cc26e81b/Iptv/pluto_tv/lib/plutotv/index.js:53:3)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
(node:7225) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7225) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Any idea why?

4v3ngR commented 10 months ago

Thank you for your report.

I've had a look and your node version is too old. You need at least node 14. The version I currently target is node 20.

Here's the officially supported versions for nodejs: https://endoflife.date/nodejs.

Interesting that Debian Buster was released in 2022 with a version of node that was already no longer supported (node 10 ended support in 2021). As such, I would not recommend using Debian as it seems they push unsupported software versions.

I've done some further tests and node 14 is the oldest supported version (as subpath imports were introduced in node 14).

I've also used this opportunity to do a version check and log an error if node is too old.

Thank you