webtorrent / webtorrent-hybrid

WebTorrent (with WebRTC support in Node.js)
https://webtorrent.io
MIT License
516 stars 98 forks source link

`npm install webtorrent-hybrid -g` fails on Ubuntu 20LTS and Windows 10 #154

Closed zackees closed 1 year ago

zackees commented 2 years ago

What version of this package are you using? Latest

What operating system, Node.js, and npm version? Ubuntu 20/Win10, npm is 8.3.0

What happened?

Windows gives this error as does Ubuntu.

npm WARN deprecated xmldom@0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm WARN deprecated ecstatic@4.1.4: This package is unmaintained and deprecated. See the GH Issue 259.
npm ERR! code 1
npm ERR! path C:\Users\niteris\AppData\Roaming\npm\node_modules\webtorrent-hybrid\node_modules\wrtc
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/download-prebuilt.js
npm ERR! 'node-pre-gyp' is not recognized as an internal or external command,
npm ERR! operable program or batch file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\niteris\AppData\Local\npm-cache\_logs\2022-02-11T05_24_27_060Z-debug-0.log

After this error I ran sudo apt install node-pre-gyp and after this I get the following error (in Ubuntu)

niteris@ubuntu:~$ sudo npm install webtorrent-hybrid -g 
npm WARN deprecated xmldom@0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm WARN deprecated ecstatic@4.1.4: This package is unmaintained and deprecated. See the GH Issue 259.
npm ERR! code 1
npm ERR! path /usr/lib/node_modules/webtorrent-hybrid/node_modules/wrtc
npm ERR! command failed
npm ERR! command sh -c node scripts/download-prebuilt.js
npm ERR! /usr/bin/env: ‘nodejs’: No such file or directory

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-02-11T05_19_47_236Z-debug-0.log

And I can confirm that I do indeed have nodejs installed on my system.

Neither Ubuntu nor Windows allows me to run webtorrent-hybrid -g

What did you expect to happen? The app to run without problem

Are you willing to submit a pull request to fix this bug? No

drakonkat commented 2 years ago

Have you tried? npm i node-pre-gyp -g

On windows what error do you have?

zackees commented 2 years ago

So the update is that your suggestion and another fixed it. So in total it was

npm -i node-pre-gyp
npm -i node-gyp
# This now works
npm install webtorrent-hybrid -g 

Can these libs be included in the npm requirements for this project? (Sorry I'm more of a python programmer I don't know what the exact terminology is).

github-actions[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

zackees commented 2 years ago

nothing has been done and this is still relevant.

DiegoRBaquero commented 2 years ago

This is not an issue with the library itself, but rather wrtc having no prebuilt binaries

zackees commented 2 years ago

Then why does

npm -i node-pre-gyp
npm -i node-gyp

Fix it? Sorry I'm not that familiar with node. I could be mistaken, but it seems like there are some missing libraries that need to be specified for the build to succeed.

github-actions[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

zackees commented 2 years ago

Just tried this install setup again and still hit the bug. It appears that node-pre-gyp and node-gyp need to be listed in the package lock file.

github-actions[bot] commented 1 year ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?