iptv-org / epg

Utilities for downloading the EPG (Electronic Program Guide) for thousands of TV channels from hundreds of sources.
https://iptv-org.github.io/
The Unlicense
1.77k stars 193 forks source link

Receiving error during EPG install #2174

Closed Shadow3766 closed 11 months ago

Shadow3766 commented 11 months ago

I am trying to install this for the first time, I am not a programmer at all.

I was following the steps here https://github.com/iptv-org/epg

During the install all the necessary dependencies step while running the NPM install command, I am receiving an error about the ELIFECYCLE. I have additional Log files i can attach if needed.

NPM LOG

0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'api:load' ] 2 info using npm@6.14.4 3 info using node@v10.19.0 4 verbose run-script [ 'preapi:load', 'api:load', 'postapi:load' ] 5 info lifecycle epg@~preapi:load: epg@ 6 info lifecycle epg@~api:load: epg@ 7 verbose lifecycle epg@~api:load: unsafe-perm in lifecycle true 8 verbose lifecycle epg@~api:load: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/sigaming/epg/node_modules/.bin:/usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/sigaming/epg/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin 9 verbose lifecycle epg@~api:load: CWD: /home/sigaming/epg 10 silly lifecycle epg@~api:load: Args: [ '-c', './scripts/commands/api/load.sh' ] 11 info lifecycle epg@~api:load: Failed to exec api:load script 12 verbose stack Error: epg@ api:load: ./scripts/commands/api/load.sh 12 verbose stack spawn ENOENT 12 verbose stack at ChildProcess. (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18) 12 verbose stack at ChildProcess.emit (events.js:198:13) 12 verbose stack at maybeClose (internal/child_process.js:982:16) 12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) 13 verbose pkgid epg@ 14 verbose cwd /home/sigaming/epg 15 verbose Linux 5.15.0-84-generic 16 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "api:load" 17 verbose node v10.19.0 18 verbose npm v6.14.4 19 error code ELIFECYCLE 20 error syscall spawn 21 error file sh 22 error errno ENOENT 23 error epg@ api:load: ./scripts/commands/api/load.sh 23 error spawn ENOENT 24 error Failed at the epg@ api:load script. 24 error This is probably not a problem with npm. There is likely additional logging output above. 25 verbose exit [ 1, true ]

Sicilykill commented 11 months ago

Not an expert but I believe all npm api:load is doing is running this shell script located in /scripts/commands/api/load.sh. I was getting the same error but that is because I m running on Windows which I am guessing might not be supported. All the script is doing is creating a directory and downloading 4 files

mkdir -p scripts/tmp/data curl -L -o scripts/tmp/data/channels.json https://iptv-org.github.io/api/channels.json curl -L -o scripts/tmp/data/countries.json https://iptv-org.github.io/api/countries.json curl -L -o scripts/tmp/data/regions.json https://iptv-org.github.io/api/regions.json curl -L -o scripts/tmp/data/subdivisions.json https://iptv-org.github.io/api/subdivisions.json

So I manually created the directory and then converted the curl command to powershell commands to download the files into the scripts/tmp/data/ folder. That seems to do the trick . I am able to properly fetch tv guides. I hope that helps.

Shadow3766 commented 11 months ago

I can try giving that a try. I am running this on Ubuntu so for me it will be a little different

KptCheeseWhiz commented 11 months ago

Hello, I have the same issue and the problem is the "shebang" operator #!/bin/bash. In environments where /bin/bash is not installed such as docker alpine images, an error is returned when running the script ./scripts/commands/api/load.sh. Installing bash in the image/environment solves the issue.

freearhey commented 11 months ago

Fixed in https://github.com/iptv-org/epg/pull/2177

Please try to update or reinstall the grabber.

maxwell-kalin commented 11 months ago
ubuntu@jay:~/epg$ npm run grab -- --site=tvguide.com 

> grab
> ts-node scripts/commands/epg/grab.ts --site=tvguide.com

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/ubuntu/epg/scripts/commands/epg/grab.ts
    at new NodeError (node:internal/errors:406:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:99:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:142:36)
    at defaultLoad (node:internal/modules/esm/load:120:20)
    at nextLoad (node:internal/modules/esm/hooks:833:28)
    at load (/home/ubuntu/epg/node_modules/ts-node/dist/child/child-loader.js:19:122)
    at nextLoad (node:internal/modules/esm/hooks:833:28)
    at Hooks.load (node:internal/modules/esm/hooks:416:26)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
maxwell-kalin commented 11 months ago

it is NOT fixed