medooze / test-server

WebRTC Test Server
MIT License
3 stars 4 forks source link

`npm install` fails on first time setup. #3

Closed akath20 closed 5 years ago

akath20 commented 5 years ago

After cloning the repo I tried to run npm install and it looks to be compiling c++ code unsuccessfully.

This could be an issue with node-gyp, but it says it's failing in the medooze-media-server.

image
murillo128 commented 5 years ago

Could you paste the errors before the screenshoot?

akath20 commented 5 years ago

Here is the full output of npm install output.txt

murillo128 commented 5 years ago
aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.13 or newer

Could this be the problem?

akath20 commented 5 years ago

I am on 10.14, but that could be a potential issue.

murillo128 commented 5 years ago

I have a problem with the xcode on my mac min, so I can`t confirm if I can reproduce it locally, but definitively that error is causing the compilation to fail (not sure about the root cause yet).

murillo128 commented 5 years ago

I have solved the problems on my mac mini and I cannot reproduce the problem locally.. :(

murillo128 commented 5 years ago

Could you try to clone the https://github.com/medooze/media-server-node directly, remove the -faligned-new in binding.gyp and try to compile it with:

npm i
akath20 commented 5 years ago

Still no luck.

image
murillo128 commented 5 years ago

You need to fetch git submodules as well, i think it is:

git submodule update --init --recursive
akath20 commented 5 years ago

Still no luck.

Submodule 'external/mp4v2/lib' (https://github.com/medooze/mp4v2.git) registered for path 'external/mp4v2/lib' Submodule 'external/srtp/lib' (https://github.com/cisco/libsrtp.git) registered for path 'external/srtp/lib' Submodule 'media-server' (https://github.com/medooze/media-server.git) registered for path 'media-server' Cloning into '/Users/alex/Documents/WebRTC/test-server/media-server-node/external/mp4v2/lib'... Cloning into '/Users/alex/Documents/WebRTC/test-server/media-server-node/external/srtp/lib'... Cloning into '/Users/alex/Documents/WebRTC/test-server/media-server-node/media-server'... Submodule path 'external/mp4v2/lib': checked out 'e2822f28cc74957573a71cc7e2c26ce7e7867e66' Submodule path 'external/srtp/lib': checked out '541c8585bfd0a2cf70225b9bc7826ee0ffef0d43' Submodule path 'media-server': checked out '38fd267c768a7e2bc1dbfe434c6407815f6094e6' Submodule 'ext/libdatachannels' (https://github.com/medooze/libdatachannels.git) registered for path 'media-server/ext/libdatachannels' Cloning into '/Users/alex/Documents/WebRTC/test-server/media-server-node/media-server/ext/libdatachannels'... Submodule path 'media-server/ext/libdatachannels': checked out '4d008acdea3b7fe2bfc8e86904dc3b76b9123467'

output.txt

akath20 commented 5 years ago

@murillo128 let's try in a common environment. With docker installed, run this command to be put into a Debain 9 image with node already installed:

docker run -it node:8 /bin/bash

I cloned this repo and ran npm install and had the same issue. Resolving it within the docker image will likely eliminate any system dependencies your system is using that wasn't initially included with the package.

josemrecio commented 5 years ago

By default debian 9 ships with gcc-6, you need gcc-7 or gcc-8. I have successfully built in debian 9 following these steps:

# add the following line to /etc/apt/sources.list
#deb http://deb.debian.org/debian testing main
sudo apt update
sudo apt upgrade
# cleanup
sudo apt --purge autoremove

# install build tools
sudo apt-get -y install git build-essential
# check gcc version, it should be version 8
#gcc --version
#g++ --version

# install nvm and node
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# logout and login again
nvm install 9.11.2
# check version
node --version

git clone --recursive https://github.com/medooze/test-server
cd test-server
npm install
murillo128 commented 5 years ago

I have also published a new version of the media-server removing the aligned new for macOS to see if it solves the original problem.

akath20 commented 5 years ago

I am trying those steps against debian now. I tried it against a ubuntu vm and didn't have luck... That would also need to work for my setup, but for now let me try debian.

akath20 commented 5 years ago

Got this to work, just for reference of what it was on Ubuntu:

replace

deb http://deb.debian.org/debian testing main -replace with ->

with

add-apt-repository ppa:ubuntu-toolchain-r/test

Thanks for the help!