node-gyp build errors while trying to install gzweb
Hi to all. I am trying to install gzweb by following the installation instructions on this site. When I get to the
sudo ./deploy.sh -m
command, I get the error message pinned here. The subsequent error message reads:
There are node-gyp build errors, exiting.
Looking at the error log, it seems there is some problem with "v8" as one recurring error message indicates:
../GZNode.cc:308:9: error: ‘Arguments’ in namespace ‘v8’ does not name a type
v8::Arguments& args)
By the way, I am running on an Ubuntu 16.04. LTS version and my nodejs version is:
$ dpkg -l nodejsDesired=Unknown/Install/Remove/Purge/Hold
|Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii nodejs 4.2.6~dfsg-1 amd64 evented I/O for V8 javascript
So it might be a problem with the nodejs version. Since I only ran
sudo apt-get install nodejs
as indicated in the instructions, I don't understand how the version number could be so different from the one indicated there. Would a downgrade fix the problem? If so, how does one do that?
Thanks a lot!!!
Asked by paulrusu on 2017-04-10 11:54:45 UTC
Answers
Which branch of gzweb are you using? I believe version 1 (i.e. gzweb_1.*
) only works with Node versions <= 0.10. If you're using one of those branches, I believe you have two options:
Downgrade your node version as described here
Use Gzweb 2 (branches
gzweb_2.*
Asked by chapulina on 2017-04-10 12:36:54 UTC
Comments
Thank you for your swift help. Unfortunately, the solution as stated does not work because after curling, it says to simply type
sudo apt-get install nodejs
but that constantly reinstalls the 4.2.6 version. I solved the problem by downloading the source code from here and building the binary. Afterwards I put it all in their corresponding files in /usr/local/ and it works .
Asked by paulrusu on 2017-04-10 14:38:04 UTC
Comments
you can use nvm to install and manage different node versions: https://github.com/creationix/nvm
Asked by iche033 on 2017-04-10 15:26:09 UTC
Hi, unkown if your trouble has been resolved but i will share with you one solution that works for me.
Uninstall nodejs by typing:
sudo apt-get remove nodejs
Download and compile node 0.10.x (in my case, 0.10.48) with the following commands:
wget http://nodejs.org/dist/v0.10.48/node-v0.10.48.tar.gz
tar -xvf node-v0.10.48.tar.gz
cd node-v0.10.48
./configure
make # It may take a few minutes.
sudo make install # Make sure to use sudo
Note: If you install nodejs with 'apt install' then will install the last version of node and return to the point of the beggining.
Now, you can install gzweb like the tutorial said:
cd ~; hg clone https://bitbucket.org/osrf/gzweb
cd ~/gzweb
hg up gzweb_1.3.0
source /usr/share/gazebo/setup.sh
./deploy.sh -m # if you want to download the models.
Asked by iarranz on 2018-01-24 07:28:35 UTC
Comments