Node.js client installation problem on Ubuntu 14.04 LTS

After installing nodejs and npm on Ubuntu 14.04 LTS, getting the following error while installing node.js aerospike client:

$sudo npm install aerospike -g

sudo: unable to resolve host test-server

npm http GET https://registry.npmjs.org/aerospike

npm http 304 https://registry.npmjs.org/aerospike

npm http GET https://registry.npmjs.org/nan

npm http 200 https://registry.npmjs.org/nan

npm http GET https://registry.npmjs.org/nan/-/nan-1.9.0.tgz

npm http 200 https://registry.npmjs.org/nan/-/nan-1.9.0.tgz

aerospike@1.0.50 install /usr/local/lib/node_modules/aerospike

node-gyp rebuild

/bin/sh: 1: node: not found

gyp: Call to ‘node -e “require(‘nan’)”’ returned exit status 127. while trying to load binding.gyp

gyp ERR! configure error

gyp ERR! stack Error: gyp failed with exit code: 1

gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)

gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)

gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)

gyp ERR! System Linux 3.13.0-24-generic

gyp ERR! command “nodejs” “/usr/bin/node-gyp” “rebuild”

gyp ERR! cwd /usr/local/lib/node_modules/aerospike

gyp ERR! node -v v0.10.25

gyp ERR! node-gyp -v v0.10.10

gyp ERR! not ok

npm WARN This failure might be due to the use of legacy binary “node”

npm WARN For further explanations, please read

/usr/share/doc/nodejs/README.Debian

npm ERR! weird error 1

npm ERR! not ok code 0

We’ve released Version 1.0.51 of the Node.js client, which fixes this error.

Please upgrade to this new version and give us feedback on your experience.

cant able to install node client

gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:198:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Linux 4.4.0-166-generic gyp ERR! command “/usr/bin/node” “/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild” gyp ERR! cwd /home/appinventiv/Desktop/mochapract1 (2)/node_modules/aerospike gyp ERR! node -v v10.17.0 gyp ERR! node-gyp -v v5.0.5 gyp ERR! not ok npm WARN mochapract1@1.0.0 No description npm WARN mochapract1@1.0.0 No repository field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! aerospike@3.13.0 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the aerospike@3.13.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/appinventiv/.npm/_logs/2019-11-08T12_05_01_675Z-debug.log