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

Error: was compiled against a different Node.js version using [webtorrent-hybrid] #1609

Closed
GilGustavoJ opened this issue Apr 5, 2019 · 2 comments

Comments

@GilGustavoJ
Copy link

@GilGustavoJ GilGustavoJ commented Apr 5, 2019

What version of WebTorrent?
Version: 0.103.1
What version of WebTorrent-Hybrid
Version: 2.1.0
What operating system and Node.js version?
Ubuntu 18.04 LTS / Version 10.15.3
What browser and version? (if using WebTorrent in the browser)
Work on Electron App (Chromium)
What did you expect to happen?
Execute npm start from console, and show the Electron App
What actually happened?

This is my package.json

{
  "name": "cotufas",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "electron main.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "electron": "^4.1.4",
    "webtorrent": "^0.103.1",
    "webtorrent-hybrid": "^2.1.0"
  }
}

My main.js

const electron = require('electron')
const webtorrent = require('webtorrent')
const webtorrent_hybrid = require('webtorrent-hybrid')
const {app, BrowserWindow} = electron

const path = require('path')
const url = require('url')

let win

let BrowserWindowOptions

function createWindow(){

	/* Establecemos las opciones de la ventana */
	BrowserWindowOptions = {
		show: false,
		background: '#212121', 
		center: true, 
		minWidth: 1024, 
		minHeight: 768,
		autoHideMenuBar: true,
		webPreferences: {
			nodeIntegration: true
		}
	}

	/* Iniciamos una nueva ventana */
	win = new BrowserWindow(BrowserWindowOptions)

	/* Cargamos la plantilla html la cual se mostrara en el Window */
	win.loadURL(url.format({
		pathname: path.join(__dirname, 'templates/home/index.html'),
		protocol: 'file',
		slashes: true
	}))

	/* Evitamos que se muestre la aplicacion en blanco */
	win.on('ready-to-show', () => {

		/* Agrandamos la ventana a la resolución de la pantalla */
		win.maximize()

		/* Mostramos la ventana cuando se tenga todo cargado */
		win.show()

		/* Developers */
		win.webContents.openDevTools()

	})

	/* Evento al cerrar la ventana */
	win.on('closed', () => {
		win = null
	})
}

/* Iniciamos nuestra aplicación */
app.on('ready', createWindow)

I am developing an application with Electron. The application is a Web Torrent Player. When executing npm start from the Linux console it shows the following error:

A JavaScript error occurred in the main process
Uncaught Exception:
Error: The module '/var/www/html/cotufas.js/node_modules/wrtc/build/Release/wrtc.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/var/www/html/cotufas.js/node_modules/wrtc/lib/binding.js:6:20)
    at Object.<anonymous> (/var/www/html/cotufas.js/node_modules/wrtc/lib/binding.js:9:3)
@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Apr 5, 2019

Duplicate

@eliooses

This comment has been minimized.

Copy link

@eliooses eliooses commented May 4, 2019

Same here.

@DiegoRBaquero which one is the original issue? please link before close.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.