Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebTorrent unable to run from npm install, assert error #309

Closed
NullCode1337 opened this issue Jun 13, 2024 · 2 comments · Fixed by webtorrent/webtorrent#2807
Closed

WebTorrent unable to run from npm install, assert error #309

NullCode1337 opened this issue Jun 13, 2024 · 2 comments · Fixed by webtorrent/webtorrent#2807

Comments

@NullCode1337
Copy link

NullCode1337 commented Jun 13, 2024

What version of this package are you using?
Running npm install webtorrent-cli -g from arch terminal

What operating system, Node.js, and npm version?
Arch Linux Hyprland, Node.js v22.3.0, [email protected]

What happened?
Followed guide to install node, npm, and webtorrent
Tried to run webtorrent, error:

nullcode1337@MONARCH ~ [1]> s webtorrent
[sudo] password for nullcode1337:
file:///usr/lib/node_modules/webtorrent-cli/node_modules/webtorrent/index.js:20
import info from './package.json' assert { type: 'json' }
                                  ^^^^^^

SyntaxError: Unexpected identifier 'assert'
    at compileSourceTextModule (node:internal/modules/esm/utils:337:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:164:18)
    at callTranslator (node:internal/modules/esm/loader:429:14)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:435:30)

Also happens when not running webtorrent via sudo, npm installation without sudo failed and I needed it for install

What did you expect to happen?
WebTorrent help menu to appear

Are you willing to submit a pull request to fix this bug?
As long as I'm guided to it

@SilentBot1
Copy link
Member

Hi there,

This is linked with an already registered issue in WebTorrent, which can be found here: webtorrent/webtorrent#2777

Due to this issue, webtorrent (and webtorrent-cli) will not work with NodeJS 22 until this is fixed and you would have to downgrade to NodeJS 21 or wait for a fix.

I'll aim to look at this today, and will try and get a fix pushed out for this.

@SilentBot1
Copy link
Member

Sorry, the above PR actually broke webtorrent-cli in it's entirety... will have to wait for 5.1.2 which will include a fix for this issue and for webtorrent-cli not working. Please keep an eye on #311 for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants