webtorrent / webtorrent-hybrid

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

error when installing webtorrent-hybrid #82

Closed ahundt closed 5 years ago

ahundt commented 6 years ago

I ran into a problem installing webtorrent-hybrid:

$ webtorrent-hybrid --help
/usr/lib/node_modules/webtorrent-hybrid/node_modules/electron/index.js:9
  throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
  ^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
    at Object.<anonymous> (/usr/lib/node_modules/webtorrent-hybrid/node_modules/electron/index.js:9:9)
    at Module._compile (internal/modules/cjs/loader.js:678:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/usr/lib/node_modules/webtorrent-hybrid/node_modules/electron-eval/lib/index.js:13:16)
    at Module._compile (internal/modules/cjs/loader.js:678:30)
cpaxton@babylon:~/.costar$ rm -rf /usr/lib/node_modules/electr^C
cpaxton@babylon:~/.costar$ ls /usr/lib/node_modules/electron
ls: cannot access /usr/lib/node_modules/electron: No such file or directory
cpaxton@babylon:~/.costar$ sudo npm install -g electron
/usr/bin/electron -> /usr/lib/node_modules/electron/cli.js

> electron@2.0.2 postinstall /usr/lib/node_modules/electron
> node install.js

$ sudo npm install electron -g
/usr/bin/electron -> /usr/lib/node_modules/electron/cli.js

> electron@2.0.2 postinstall /usr/lib/node_modules/electron
> node install.js

(node:15087) ExperimentalWarning: The fs.promises API is experimental
/usr/lib/node_modules/electron/install.js:47
  throw err
  ^

Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/electron/.electron'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@2.0.2 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron@2.0.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cpaxton/.npm/_logs/2018-06-14T00_39_24_833Z-debug.log

Here is the version information:

$ npm --version
5.6.0
$ which npm
/usr/bin/npm
$ ls /usr/local/bin/npm
ls: cannot access /usr/local/bin/npm: No such file or directory
$ node --version
v10.1.0
wdfsinap commented 6 years ago

I have the same problem. please help to solve the issue. thanks

neuronsupport commented 6 years ago

have you installed electron?

npm install electron

DiegoRBaquero commented 6 years ago

You don't need to install Electron on your own (Plus you'd be installing v2, we use v1).

Would be nice to have more detail as to why Electron install, as a dependency, is failing.

DiegoRBaquero commented 5 years ago

Migrated to wrtc