bobvanderlinden / node-machinetalk

A client-side Node API for remotely controlling/monitoring Machinekit instances through Machinetalk
GNU Lesser General Public License v3.0
2 stars 4 forks source link

node-gyp rebuild fails #14

Closed zhivko closed 8 years ago

zhivko commented 8 years ago

Installing with: npm install --save machinetalk I get this error:

kz@klemenHp:/media/kz/Extra10GB/git$ npm install --save machinetalk \

mdns@2.2.11 install /media/kz/Extra10GB/git/node_modules/machinetalk/node_modules/mdns 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:344: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.19.0-41-generic gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild" gyp ERR! cwd /media/kz/Extra10GB/git/node_modules/machinetalk/node_modules/mdns gyp ERR! node -v v0.10.25 gyp ERR! node-gyp -v v0.12.2 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

zmq@2.14.0 install /media/kz/Extra10GB/git/node_modules/machinetalk/node_modules/zmq node-gyp rebuild

gyp ERR! UNCAUGHT EXCEPTION gyp ERR! stack Error: ENOENT, no such file or directory gyp ERR! stack at process.cwd (/usr/lib/nodejs/graceful-fs/polyfills.js:8:19) gyp ERR! stack at Object.exports.resolve (path.js:309:52) gyp ERR! stack at configure (/usr/share/node-gyp/lib/configure.js:26:23) gyp ERR! stack at Object.self.commands.(anonymous function) as configure gyp ERR! stack at run (/usr/share/node-gyp/bin/node-gyp.js:72:30) gyp ERR! stack at process._tickCallback (node.js:415:13) gyp ERR! System Linux 3.19.0-41-generic gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"

/usr/lib/nodejs/graceful-fs/polyfills.js:8 cwd = origCwd.call(process) ^ Error: ENOENT, no such file or directory at process.cwd (/usr/lib/nodejs/graceful-fs/polyfills.js:8:19) at errorMessage (/usr/share/node-gyp/bin/node-gyp.js:119:28) at issueMessage (/usr/share/node-gyp/bin/node-gyp.js:125:3) at process. (/usr/share/node-gyp/bin/node-gyp.js:109:3) at process.EventEmitter.emit (events.js:95:17) at process._fatalException (node.js:272:26) npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/media/kz/Extra10GB/git/node_modules/machinetalk/node_modules/protobufjs' npm ERR! error rolling back machinetalk@1.2.0 { [Error: ENOTEMPTY, rmdir '/media/kz/Extra10GB/git/node_modules/machinetalk/node_modules/protobufjs'] npm ERR! error rolling back errno: 53, npm ERR! error rolling back code: 'ENOTEMPTY', npm ERR! error rolling back path: '/media/kz/Extra10GB/git/node_modules/machinetalk/node_modules/protobufjs' } npm ERR! mdns@2.2.11 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the mdns@2.2.11 install script. npm ERR! This is most likely a problem with the mdns package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls mdns npm ERR! There is likely additional logging output above. npm ERR! System Linux 3.19.0-41-generic npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "machinetalk" npm ERR! cwd /media/kz/Extra10GB/git npm ERR! node -v v0.10.25 npm ERR! npm -v 1.4.21 npm ERR! code ELIFECYCLE 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! npm ERR! Additional logging details can be found in: npm ERR! /media/kz/Extra10GB/git/npm-debug.log npm ERR! not ok code 0

npm-debug.log.zip

bobvanderlinden commented 8 years ago

The problem seems to be: /bin/sh: 1: node: not found It is triggered because mdns uses node as the executable name for NodeJS, whereas the standard package of Debian uses nodejs. I think this is solved in newer Debian packages for the LTS release of NodeJS by using node as the executable name. More info here: https://nodejs.org/en/download/package-manager/

It also says the following:

A Node.js package is also available in the official repo for Debian Sid (unstable), Jessie (testing) and Wheezy (wheezy-backports) as "nodejs". It only installs a nodejs binary, so you might want to ln -s /usr/bin/nodejs /usr/bin/node for many things to work.

So I guess ln -s /usr/bin/nodejs /usr/bin/node should work for you as well.

zhivko commented 8 years ago

OK make a progress with that tip but now I get: kz@klemenHp:/media/kz/Extra10GB/git$ sudo ln -s /usr/bin/nodejs /usr/bin/node [sudo] password for kz: kz@klemenHp:/media/kz/Extra10GB/git$ npm install --save machinetalk |

mdns@2.2.11 install /media/kz/Extra10GB/git/node_modules/machinetalk/node_modules/mdns node-gyp rebuild

make: Entering directory '/media/kz/Extra10GB/git/node_modules/machinetalk/node_modules/mdns/build' CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o In file included from ../src/dns_sd.cpp:1:0: ../src/mdns.hpp:32:20: fatal error: dns_sd.h: No such file or directory

include

                ^

compilation terminated.

Do I need sources for mdns ? If yes how to get them? I'm on: kz@klemenHp:/media/kz/Extra10GB/git$ uname -a Linux klemenHp 3.19.0-41-generic #46-Ubuntu SMP Fri Dec 4 18:17:18 UTC 2015 i686 i686 i686 GNU/Linux

zhivko commented 8 years ago

Ah OK that helped: sudo apt-get install libavahi-compat-libdnssd-dev