Giter VIP home page Giter VIP logo

Comments (6)

mrxdst avatar mrxdst commented on May 30, 2024

[webtorrent] Failed to get node script path

This error can occur if the node command is not available in your path.
My best guess is that the command is called nodejs on your system.

I have updated the hook with a more descriptive error.
And also added a script option to specify the command to use.

Version 1.3.3

In mpv/script-opts/webtorrent.conf, add the following:

node_path=nodejs

from webtorrent-mpv-hook.

metapea avatar metapea commented on May 30, 2024

I've changed node_path: 'node' to node_path=nodejs and node_path: 'nodejs', but i still got an error:

[input] Command 'loop-file=inf' not found.
[input] Command was defined at /mpv/mpv/input.conf:
2.
Can't load unknown script: /mpv/mpv/scripts/win-hel
per.vbs
Cannot find main.* for any supported scripting backend in: /mpv/mpv/scripts/modules
[assrt]
[assrt] stack traceback:
[assrt]         [string "/mpv/mpv/scripts..."]:26:
in main chunk
[assrt]         [C]: at 0x0140083340
[assrt]         [C]: at 0x01400815c0
[assrt] Lua error: [string "/mpv/mpv/scripts..."]:2
6: module 'modules.AssFormat' not found:
[assrt]         no field package.preload['modules.AssFormat']
[assrt]         no file ':mpv/mpv/scripts/modules\As
sFormat.lua'
[assrt]         no file '\mpv\lua\modules\AssFormat
.lua'
[assrt]         no file '\mpv\lua\modules\AssFormat
\init.lua'
[assrt]         no file '\mpv\modules\AssFormat.dll
'
[assrt]         no file 'mpv\loadall.dll'
[assrt]         no file 'mpv\modules.dll'
[assrt]         no file '\mpv\loadall.dll'
[file] Cannot open file 'magnet:': Invalid argument
Failed to open magnet:
[webtorrent] Running WebTorrent hook
[webtorrent] Failed to get node script path. Possible causes are "nodejs" not av
ailable in path or incorrect symlink.

Exiting... (Errors when loading file)
'dn' is not recognized as an internal or external command,
operable program or batch file.
'tr' is not recognized as an internal or external command,
operable program or batch file.
'tr' is not recognized as an internal or external command,
operable program or batch file.
'tr' is not recognized as an internal or external command,
operable program or batch file.
'tr' is not recognized as an internal or external command,
operable program or batch file.
'tr' is not recognized as an internal or external command,
operable program or batch file.

also there's no .conf, i'm using windows

from webtorrent-mpv-hook.

mrxdst avatar mrxdst commented on May 30, 2024

OK. so my initial assessment was wrong. On windows it should be called node.

Please post the output from running the following commands in cmd (not powershell):

  1. node --version
  2. npm list -g webtorrent-mpv-hook
  3. dir %APPDATA%\mpv\scripts

Also when running mpv make sure to put the magnet link withing "quotation marks" if you are not already doing that.

from webtorrent-mpv-hook.

metapea avatar metapea commented on May 30, 2024

node --version:
v16.14.0

npm list -g webtorrent-mpv-hook:
-- [email protected]

dir:

03/22/2022  06:57 PM    <DIR>          .
03/22/2022  06:57 PM    <DIR>          ..
06/30/2020  10:05 AM            14,720 assrt.lua
06/30/2020  10:05 AM    <DIR>          modules
05/09/2020  08:25 AM            70,699 webm.lua
02/28/2022  04:20 PM    <SYMLINK>      webtorrent.js [..\..\..\..\Program Files\
node\node_modules\webtorrent-mpv-hook\build\webtorrent.js]
06/30/2020  10:05 AM               571 win-helper.vbs
               4 File(s)         85,990 bytes
               3 Dir(s)  306,714,107,904 bytes free

from webtorrent-mpv-hook.

mrxdst avatar mrxdst commented on May 30, 2024

The output from dir is interesting. There are multiple things that differs from the machine i'm testing on.

  • Your symlink is relative while for me it's absolute. I would not expect this to matter but maybe it does.
  • Your the file seems to be linked to a package install location in C:\Program Files\node\node_modules.
    However I would expect the package to be installed in C:\Users\You\AppData\Roaming\npm\node_modules.
    Not sure why npm would do that.
  • Further the node install directory is also different. For me it's C:\Program Files\nodejs but for you it appears to be C:\Program Files\node

This really raises more questions than it answers.

If you want you could try editing the webtorrent.js file and drop some print() statements into the function getNodeScriptPath().
Fore example print(JSON.stringify(realPath, null, 2)); before the try { clause.

from webtorrent-mpv-hook.

metapea avatar metapea commented on May 30, 2024

The output from dir is interesting. There are multiple things that differs from the machine i'm testing on.

  • Your symlink is relative while for me it's absolute. I would not expect this to matter but maybe it does.
  • Your the file seems to be linked to a package install location in C:\Program Files\node\node_modules.
    However I would expect the package to be installed in C:\Users\You\AppData\Roaming\npm\node_modules.
    Not sure why npm would do that.
  • Further the node install directory is also different. For me it's C:\Program Files\nodejs but for you it appears to be C:\Program Files\node

This really raises more questions than it answers.

It's not "installed", both mpv and the node are from zip files

If you want you could try editing the webtorrent.js
print(JSON.stringify(realPath, null, 2));

thanks, i try it

from webtorrent-mpv-hook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.