Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

WebRTC error: node-pre-gyp ERR! #777

Closed
KRYPTOHAUS opened this issue Feb 25, 2017 · 5 comments
Closed

WebRTC error: node-pre-gyp ERR! #777

KRYPTOHAUS opened this issue Feb 25, 2017 · 5 comments

Comments

@KRYPTOHAUS
Copy link

When attempting to install jsipfs I encounter a build error towards the end of the process. I start this with the following command: 'sudo npm install ipfs --global' I've tried using '--unsafe_perm' as well.

The entry labelled under "IPFS Error" shows what console output I get relevant to this issue.

After a bit of troubleshooting I found this to be a problem with gyp and the node webrtc stack. I updated gyp and no longer received errors from it. The Node WebRTC stack however still throws errors. The error info relevant to this is under "WebRTC error." When attempting to install/update the WebRTC node stack I use the following command:

I've tried the following; to no avail : 'Try building from source by setting BUILD_WEBRTC=1.'

You'll notice they are almost identical, I believe this is a problem with WebRTC more than the IPFS install scripts, but a bug post here will allow more people to be aware of this issue.

IPFS Error:
node-pre-gyp ERR!

Tried to download(404): https://node-webrtc.s3.amazonaws.com/wrtc/v0.0.61/Release/node-v46-linux-ia32.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v46 ABI) (falling back to source compile with node-gyp)
make: Entering directory '/usr/local/lib/node_modules/ipfs/node_modules/wrtc/build'
ACTION Downloading WebRTC libraries and headers third_party/webrtc

[email protected] download-webrtc-libraries-and-headers /usr/local/lib/node_modules/ipfs/node_modules/wrtc
node scripts/download-webrtc-libraries-and-headers.js

Attempting to download WebRTC libraries and headers for platform "linux" and architecture "ia32" from

https://webrtc-libraries-and-headers.s3.amazonaws.com/v1/build/webrtc-50%2B49f7bd3.linux.ia32.tar.gz

Binaries unavailable! Try building from source by setting BUILD_WEBRTC=1.

npm ERR! Linux 4.4.0-62-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "download-webrtc-libraries-and-headers"
npm ERR! node v4.4.2
npm ERR! npm v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] download-webrtc-libraries-and-headers: node scripts/download-webrtc-libraries-and-headers.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] download-webrtc-libraries-and-headers script 'node scripts/download-webrtc-libraries-and-headers.js'.
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 scripts/download-webrtc-libraries-and-headers.js
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/kryptodev/.npm/_logs/2017-02-25T22_25_27_190Z-debug.log
action_before_build.target.mk:13: recipe for target 'third_party/webrtc' failed
make: *** [third_party/webrtc] Error 1
make: Leaving directory '/usr/local/lib/node_modules/ipfs/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/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-62-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/local/lib/node_modules/ipfs/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32/wrtc.node" "--module_name=wrtc" "--module_path=/usr/local/lib/node_modules/ipfs/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32"
gyp ERR! cwd /usr/local/lib/node_modules/ipfs/node_modules/wrtc
gyp ERR! node -v v4.4.2
gyp ERR! node-gyp -v v3.5.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/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/ipfs/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32/wrtc.node --module_name=wrtc --module_path=/usr/local/lib/node_modules/ipfs/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32' (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/ipfs/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 4.4.0-62-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/ipfs/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/ipfs/node_modules/wrtc
node-pre-gyp ERR! node -v v4.4.2
node-pre-gyp ERR! node-pre-gyp -v v0.6.33
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/ipfs/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32/wrtc.node --module_name=wrtc --module_path=/usr/local/lib/node_modules/ipfs/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32' (1)

WebRTC Error:

node-pre-gyp ERR! Tried to download(404): https://node-webrtc.s3.amazonaws.com/wrtc/v0.0.61/Release/node-v46-linux-ia32.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v46 ABI) (falling back to source compile with node-gyp)
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/kryptodev/.node-gyp/4.4.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/wrtc/.node-gyp"
make: Entering directory '/usr/local/lib/node_modules/wrtc/build'
make: *** No rule to make target '../.node-gyp/4.4.2/include/node/common.gypi', needed by 'Makefile'. Stop.
make: Leaving directory '/usr/local/lib/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/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-62-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/local/lib/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32/wrtc.node" "--module_name=wrtc" "--module_path=/usr/local/lib/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32"
gyp ERR! cwd /usr/local/lib/node_modules/wrtc
gyp ERR! node -v v4.4.2
gyp ERR! node-gyp -v v3.5.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/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32/wrtc.node --module_name=wrtc --module_path=/usr/local/lib/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32' (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/wrtc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 4.4.0-62-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/wrtc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/wrtc
node-pre-gyp ERR! node -v v4.4.2
node-pre-gyp ERR! node-pre-gyp -v v0.6.33
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32/wrtc.node --module_name=wrtc --module_path=/usr/local/lib/node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v46-linux-ia32' (1)
npm ERR! Linux 4.4.0-62-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "wrtc" "--global" "--unsafe_perm"
npm ERR! node v4.4.2
npm ERR! npm v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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/kryptodev/.npm/_logs/2017-02-25T22_26_35_758Z-debug.log

@compsocial
Copy link

I had a similar issue on OS X. If you visit the wrtc package page, it will list a number of development packages you need installed at compilation time. That may be at the root of your problem.

@daviddias
Copy link
Member

@KRYPTOHAUS after you install the pre-requisites listed on https://www.npmjs.com/package/wrtc#prerequisites, does it work for you? I believe I didn't have to do anything other than installing xcode in all my 3 machines to make it work, but if you find this to be the solution for you, I'll add it to the install notes.

@daviddias daviddias added status/ready Ready to be worked status/deferred Conscious decision to pause or backlog and removed status/ready Ready to be worked labels Mar 9, 2017
@KRYPTOHAUS
Copy link
Author

KRYPTOHAUS commented Mar 9, 2017

All that was suggested was tried... it would not work. Only when we installed Linux from scratch did we gain any ground. We needed Linux 14 rather than the updated 16 that we were on before. On 14, it installs perfectly.

Closing issue :)

@jbenet jbenet removed the status/deferred Conscious decision to pause or backlog label Mar 9, 2017
@victorb
Copy link
Member

victorb commented Mar 10, 2017

@KRYPTOHAUS this is very useful information, but it's unclear what you mean with "Linux 14" and "16". Are you talking about version of a specific Linux distribution (seems to be Ubuntu version?) or the kernel itself? If we can verify that downgrading helps, it'll be useful information to put in our readme for both js-ipfs and js-libp2p-webrtc-star

@jaycenhorton
Copy link

With the same problem I was able to move forward by downgrading from an ec2 instance of:
Ubuntu Server 16.04 LTS
to
Ubuntu Server 14.04 LTS
(granted I'm sure some missing step from below will still allow you to get up and running in 16.04, but this was a bit too much of a headache)

sudo apt-get update
sudo apt-get upgrade
Sudo apt-get install git make g++ build-essential

(^ might need to run with --fix-missing)

Install nvm:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
nvm install node
nvm use node

npm install ipfs --global

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

No branches or pull requests

6 participants