Gzweb build errors (node-gyp build error)


#1

I am having trouble compiling the nrp. I am compiling from within a freshly installed vm (KVM with qemu) with 8GB of RAM and two cores dedicated to it. Nothing else has been done in the vm except for installing vim and tmux and enabling a service to be able to “virsh console” (access to a tty from host terminal) into the vm. Guest is Ubuntu 16.04 Host is Ubuntu 18.04.

The error occurs when compiling gzweb just after building gzcoarse:

Scanning dependencies of target gzcoarse
[ 50%] Building CXX object tools/CMakeFiles/gzcoarse.dir/gzcoarse.cc.o
[100%] Linking CXX executable gzcoarse
[100%] Built target gzcoarse
gyp info it worked if it ends with ok
gyp info using node-gyp@4.0.0
gyp info using node@0.10.48 | linux | x64
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR

/home/pkrack/Documents/NRP/gzweb/node_modules/node-gyp/node_modules/tar/lib/create.js:4
const hlo = require('./high-level-opt.js')
^^^^^
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack SyntaxError: Use of const in strict mode.
gyp ERR! stack     at Module._compile (module.js:439:25)
gyp ERR! stack     at Object.Module._extensions..js (module.js:474:10)
gyp ERR! stack     at Module.load (module.js:356:32)
gyp ERR! stack     at Function.Module._load (module.js:312:12)
gyp ERR! stack     at Module.require (module.js:364:17)
gyp ERR! stack     at require (module.js:380:17)
gyp ERR! stack     at Object.<anonymous> (/home/pkrack/Documents/NRP/gzweb/node_modules/node-gyp/node_modules/tar/index.js:4:30)
gyp ERR! stack     at Module._compile (module.js:456:26)
gyp ERR! stack     at Object.Module._extensions..js (module.js:474:10)
gyp ERR! stack     at Module.load (module.js:356:32)
gyp ERR! System Linux 4.15.0-48-generic
gyp ERR! command "node" "/home/pkrack/Documents/NRP/gzweb/node_modules/.bin/node-gyp" "configure"
gyp ERR! cwd /home/pkrack/Documents/NRP/gzweb/gzbridge
gyp ERR! node -v v0.10.48
gyp ERR! node-gyp -v v4.0.0
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
gyp info it worked if it ends with ok
gyp info using node-gyp@4.0.0
gyp info using node@0.10.48 | linux | x64
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp ERR! build error
gyp ERR! stack Error: You must run `node-gyp configure` first!
gyp ERR! stack     at /home/pkrack/Documents/NRP/gzweb/node_modules/node-gyp/lib/build.js:53:20
gyp ERR! stack     at /home/pkrack/Documents/NRP/gzweb/node_modules/node-gyp/node_modules/graceful-fs/graceful-fs.js:90:16
gyp ERR! stack     at fs.js:208:20
gyp ERR! stack     at Object.oncomplete (fs.js:108:15)
gyp ERR! System Linux 4.15.0-48-generic
gyp ERR! command "node" "/home/pkrack/Documents/NRP/gzweb/node_modules/.bin/node-gyp" "build" "-r"
gyp ERR! cwd /home/pkrack/Documents/NRP/gzweb/gzbridge
gyp ERR! node -v v0.10.48
gyp ERR! node-gyp -v v4.0.0
gyp ERR! not ok
There are node-gyp build errors, exiting.
GZBRIDGE BUILD ERROR

I have tried deleting the node_modules folder inside gzweb. Did not change anything.
Also something that might be related:

-------------------------
gzweb
-------------------------
Now using node v0.10.48 (npm v2.15.1)
npm WARN package.json gzweb@2.1.3 No license field.
./deploy-gzbridge-nrp.sh: line 21: bower: command not found

bower is installed and I tried to reinstall it several times without it making any difference.
Thank you in advance for every contribution.


#2

Hi Patrick,

This issue has been fixed in our development branch, and will soon be available in the master branch as well. It is an issue caused not by the nrp but by the latest release of node-gyp. The fix is quite easy, you just need to go to the gzweb repo and modify the package.json file and enforce the node-gyp version to be 3.8.0 . Then remove the node-modules and do an npm install. In summary

cd $HBP/gzweb
nano package.json
change the line node-gyp = " " to node-gyp= “3.8.0”
rm -rf node_modules
npm install

Then you can resume the installation process. I hope it helps, thanks for reporting the issus.

Best,
Manos


#3

For your information, a new release of the NRP has happened so the fix mentioned here is now deployed.

Axel