KordonBleu / enslavism

A framework to manage distributed WebRTC servers that communicate with browser clients
Mozilla Public License 2.0
145 stars 5 forks source link

node-pre-gyp error, cannot find binaries for wrtc #1

Closed moeiscool closed 7 years ago

moeiscool commented 7 years ago

When i try to npm install enslavism i get an error with wrtc. I am not sure how to deal with it. Any help would be appreciated!

OS: Ubuntu 16.04

I am running the commands as root.

> wrtc@0.0.61 install /home/nodejs/cloudcam/node_modules/wrtc
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://node-webrtc.s3.amazonaws.com/wrtc/v0.0.61/Release/node-v51-linux-ia32.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for wrtc@0.0.61 and node@7.2.0 (node-v51 ABI) (falling back to source compile with node-gyp)
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/7.2.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/nodejs/cloudcam/node_modules/wrtc/.node-gyp"
make: Entering directory '/home/nodejs/cloudcam/node_modules/wrtc/build'
make: *** No rule to make target '../.node-gyp/7.2.0/include/node/common.gypi', needed by 'Makefile'.  Stop.
make: Leaving directory '/home/nodejs/cloudcam/node_modules/wrtc/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.0-51-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/nodejs/cloudcam/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v51-linux-ia32/wrtc.node" "--module_name=wrtc" "--module_path=/home/nodejs/cloudcam/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v51-linux-ia32"
gyp ERR! cwd /home/nodejs/cloudcam/node_modules/wrtc
gyp ERR! node -v v7.2.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/nodejs/cloudcam/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v51-linux-ia32/wrtc.node --module_name=wrtc --module_path=/home/nodejs/cloudcam/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v51-linux-ia32' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/nodejs/cloudcam/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:885:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 4.4.0-51-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/nodejs/cloudcam/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/nodejs/cloudcam/node_modules/wrtc
node-pre-gyp ERR! node -v v7.2.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/nodejs/cloudcam/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v51-linux-ia32/wrtc.node --module_name=wrtc --module_path=/home/nodejs/cloudcam/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v51-linux-ia32' (1)
npm ERR! Linux 4.4.0-51-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "wrtc"
npm ERR! node v7.2.0
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE

npm ERR! wrtc@0.0.61 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wrtc@0.0.61 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the wrtc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs wrtc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls wrtc
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/nodejs/cloudcam/npm-debug.log
getkey commented 7 years ago

Yes, it fails to install as root, which is an upstream bug. I'll submit an issue.

I do not recommend installing it as root though, why do you want to do that?

moeiscool commented 7 years ago

i just use my terminal in root, so i dont have to deal with other errors that need me to be root :P . i also tried to install it without root.. it looks like it installs okay but i get a throw error saying wrtc is not defined or something when i try to run the application with node testfile.js.

oh yes the specific reason why i use root is because express or http cant bind to ports without me being in root.

getkey commented 7 years ago

You have to be root to bind to ports below 1024. What you should do is program as an normal user and either start your server for example on port 8080, or run only your server as root. Or you will learn the hard way using root all the time is dangerous. ;-)

Anyway, can you provide a log on the second issue you are experiencing? Edit: I just published a new version that might fix your problem. Please run npm install enslavism again!

moeiscool commented 7 years ago
module.js:472
    throw err;
    ^

Error: Cannot find module '/home/nodejs/cloudcam/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v51-linux-ia32/wrtc.node'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/nodejs/cloudcam/node_modules/wrtc/lib/peerconnection.js:6:15)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
getkey commented 7 years ago

Please report the bug upstream. I think your 32-bit CPU is not supported. When you did npm install, were there any errors?

A workaround is to build wrtc then to symlink or copy the wrtc.node binary to /home/nodejs/cloudcam/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v51-linux-ia32/wrtc.node.