patrickkfkan / volumio-ytcr

16 stars 3 forks source link

No modules found, running "npm install" #2

Open maxdd opened 3 years ago

maxdd commented 3 years ago

Hi, i'm facing two similar issue with two distinct setups

On my odroid C1+ i'm receiving

volumio plugin install

This command will install the plugin on your device

Compressing the plugin
No modules found, running "npm install"

On my docker on focal 20.04 instead

volumio plugin install

This command will install the plugin on your device

Compressing the plugin
No modules found, running "npm install"
/bin/sh: 1: /usr/local/bin/npm: not found
Error installing node modules: Error: Command failed: /usr/local/bin/npm install --production
/bin/sh: 1: /usr/local/bin/npm: not found

/bin/mv: cannot stat '*.zip': No such file or directory
child_process.js:650
    throw err;
    ^

Error: Command failed: /bin/mv *.zip /tmp/plugins/ytcr.zip
/bin/mv: cannot stat '*.zip': No such file or directory

    at checkExecSyncError (child_process.js:607:13)
    at execSync (child_process.js:647:13)
    at install (/volumio/pluginhelper.js:689:9)
    at Object.<anonymous> (/volumio/pluginhelper.js:751:9)
    at Module._compile (module.js:653:30)
    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 Function.Module.runMain (module.js:694:10)

in the first case if i redo volumio plugin install, it installs even though the script doesnt return in the second case it gets stuck here

(docker) root@777b75e901a2:/ytcr-plugin/volumio-ytcr# npm install
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN notsup Unsupported engine for mpd-api@1.1.0: wanted: {"node":">=11.0.0"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: mpd-api@1.1.0
npm WARN notsup Unsupported engine for ytdl-core@0.0.0-development: wanted: {"node":">=10"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: ytdl-core@0.0.0-development
npm WARN notsup Unsupported engine for strtok3@6.2.4: wanted: {"node":">=10"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: strtok3@6.2.4
npm WARN notsup Unsupported engine for m3u8stream@0.8.4: wanted: {"node":">=10"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: m3u8stream@0.8.4
npm WARN notsup Unsupported engine for miniget@4.2.0: wanted: {"node":">=10"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: miniget@4.2.0

added 156 packages from 174 contributors and audited 156 packages in 27.149s

6 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
(docker) root@777b75e901a2:/ytcr-plugin/volumio-ytcr# volumio plugin install

This command will install the plugin on your device

Compressing the plugin
Plugin succesfully compressed
Progress: 10
Status :Downloading plugin
Downloading plugin at http://127.0.0.1:3000/plugin-serve/ytcr.zip

do you happen to have an idea how can i debug this second case?

maxdd commented 3 years ago

For the setup 2 I manually copied the plugin into /data/plugins/music_service/ytcr and refreshed it. The plugin appears in the list now but even if I toggle it it remains inactive and if I go to setting it says No configuration. I'm currently using latest commits of volumio2 and volumio2-ui for my docker

maxdd commented 3 years ago

Ok so i tried to place the plugin inside /data/plugins/media_service/ytcr and after startup issuing the command npm install. At this point i have turned on and off the plugin and im receiving the following:

|||||||||||||||||||||||| WARNING: FATAL ERROR |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
volumio    | TypeError: Cannot read property 'stop' of undefined
volumio    |     at ControllerYTCR.onStop (/data/plugins/music_service/ytcr/index.js:337:19)
volumio    |     at PluginManager.stopPlugin (/volumio/app/pluginmanager.js:341:30)
volumio    |     at PluginManager.disableAndStopPlugin (/volumio/app/pluginmanager.js:1567:8)
volumio    |     at CoreCommandRouter.disableAndStopPlugin (/volumio/app/index.js:1451:29)
volumio    |     at Socket.<anonymous> (/volumio/app/plugins/user_interface/websocket/index.js:1213:47)
volumio    |     at emitTwo (events.js:126:13)
volumio    |     at Socket.emit (events.js:214:7)
volumio    |     at /volumio/node_modules/socket.io/lib/socket.js:503:12
volumio    |     at _combinedTickCallback (internal/process/next_tick.js:132:7)
volumio    |     at process._tickCallback (internal/process/next_tick.js:181:9)
volumio    | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Error: bind EADDRINUSE null:3001
volumio    |     at listenOnMasterHandle (net.js:1420:16)
volumio    |     at rr (internal/cluster/child.js:121:12)
volumio    |     at Worker.send (internal/cluster/child.js:88:7)
volumio    |     at process.onInternalMessage (internal/cluster/utils.js:42:8)
volumio    |     at emitTwo (events.js:131:20)
volumio    |     at process.emit (events.js:214:7)
volumio    |     at emit (internal/child_process.js:762:12)
volumio    |     at _combinedTickCallback (internal/process/next_tick.js:142:11)
volumio    |     at process._tickCallback (internal/process/next_tick.js:181:9)
volumio    | events.js:183
volumio    |       throw er; // Unhandled 'error' event
patrickkfkan commented 3 years ago

On my odroid C1+ i'm receiving

volumio plugin install

This command will install the plugin on your device

Compressing the plugin
No modules found, running "npm install"

Did you actually wait for the process to exit, or did you force abort in the middle of "No modules found, running npm install"?

Error: bind EADDRINUSE null:3001 volumio | at listenOnMasterHandle (net.js:1420:16) volumio | at rr (internal/cluster/child.js:121:12) volumio | at Worker.send (internal/cluster/child.js:88:7) volumio | at process.onInternalMessage (internal/cluster/utils.js:42:8) volumio | at emitTwo (events.js:131:20) volumio | at process.emit (events.js:214:7) volumio | at emit (internal/child_process.js:762:12) volumio | at _combinedTickCallback (internal/process/next_tick.js:142:11) volumio | at process._tickCallback (internal/process/next_tick.js:181:9) volumio | events.js:183 volumio | throw er; // Unhandled 'error' event

I'm not sure if this plugin will work in a docker container. The error reports that port number 3001 is already in use. However, the plugin listens on port 8098 so this itself shouldn't trigger the error. But even if you are able to get the plugin running, I'm not sure if any specific configuration is required for the container so that it can relay the SSDP packets back and forth...

maxdd commented 3 years ago

Regarding the first log setup it exited on its own. Regarding the second is it even correct to have NULL in the address? About the SSDP i see no issue as long as i forward the proper port

patrickkfkan commented 3 years ago

You opened another issue and then closed it. So you are able to install on Odroid after all?

maxdd commented 3 years ago

Yes on the odroid, something strange happened though, the progress reached 100 and then went back to 70 (had to Ctrl+C) but the plugin is there and it's working although without seeking (i had some deprecated library message during npm) About the second case, what node is required for this plugin?

patrickkfkan commented 3 years ago

Yes on the odroid, something strange happened though, the progress reached 100 and then went back to 70 (had to Ctrl+C) but the plugin is there and it's working although without seeking (i had some deprecated library message during npm)

This behaviour is 'normal' due to Volumio's implementation and not specific to Odroid. Deprecated library messages during npm are due to legacy Node version used by Volumio but the plugin has been tested to work regardless.

The legacy MPD version used by Volumio is known to cause seeking and cut-off issues with YouTube streams, unless you update it as described in the README.

About the second case, what node is required for this plugin?

Frankly, I have no idea. Running Volumio in docker is not officially supported and there may or may not be things relating to the container itself that could break the plugin...The error you see indicates that port 3001 is used, so you should at least investigate why it is being used and what process is using it (the plugin uses 8098 by default).

maxdd commented 3 years ago

Ok so i first fixed the npm install issue by symlinking npm to my "which" location. What i am now investigating is if these WARN are actually acceptable (i don't remember them on the odroid)

npm WARN notsup Unsupported engine for mpd-api@1.1.0: wanted: {"node":">=11.0.0"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: mpd-api@1.1.0
npm WARN notsup Unsupported engine for ytdl-core@0.0.0-development: wanted: {"node":">=10"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: ytdl-core@0.0.0-development
npm WARN notsup Unsupported engine for strtok3@6.2.4: wanted: {"node":">=10"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: strtok3@6.2.4
npm WARN notsup Unsupported engine for m3u8stream@0.8.4: wanted: {"node":">=10"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: m3u8stream@0.8.4
npm WARN notsup Unsupported engine for miniget@4.2.0: wanted: {"node":">=10"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: miniget@4.2.0

before i asked you which the node version we are expecting to use since on my odroid i have

volumio@volumio_odroid:~$ node -v
v8.11.1

volumio@volumio_odroid:~$ npm version
{ npm: '5.6.0',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.11.1',
  openssl: '1.0.2o',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.19.1',
  v8: '6.2.414.50',
  zlib: '1.2.11' }

while on my docker i have

root@f5dce3a92d4b:~/volumio-ytcr# node -v
v8.17.0

root@f5dce3a92d4b:~/volumio-ytcr# npm version
{ ytcr: '0.1.0a-20210627',
  npm: '6.13.4',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  napi: '4',
  nghttp2: '1.39.2',
  node: '8.17.0',
  openssl: '1.0.2s',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.23.2',
  v8: '6.2.414.78',
  zlib: '1.2.11' }
maxdd commented 3 years ago

Also i've seen a similar thread on stackoverflow

https://stackoverflow.com/questions/64172849/docker-compose-results-in-error-listen-eaddrinuse-address-already-in-use-30

Who is launching the index.js file? is it volumio/volumio ui?

patrickkfkan commented 3 years ago

The odroid one has the same node / npm versions as standard Volumio.

The WARN messages are just warnings and the node modules should still be fetched and installed.

It is likely that modifications to standard Volumio have been made to make it work with docker. You should instead check with the author of Volumio docker instead of me or the Volumio team. I don't think the issue arises from the plugin itself (because it works in standard Volumio), but the environment in which it is being run.

maxdd commented 3 years ago

I have to agree on this. I'll try Volumio3 for x86/x64 platform, do you know if your plugin should still work?

patrickkfkan commented 3 years ago

It works with Volumio 3 (to clarify - not docker)