Robotjs: Failed to install robotjs on Raspberry Pi Zero W (Raspbian Jessie)

Created on 17 Aug 2017  Â·  3Comments  Â·  Source: octalmage/robotjs

I have been able to instal robotjs on Pi 3. But unable to do so on Pi Zero W. The point of failure appears to be this: ../src/mouse.c:12:35: fatal error: X11/extensions/XTest.h: No such file or directory
#include

Complete output:
sudo npm i robotjs

[email protected] install /home/pi/node_modules/robotjs
prebuild-install || node-gyp rebuild

prebuild-install info begin Prebuild-install version 2.2.2
prebuild-install info looking for local prebuild @ prebuilds/robotjs-v0.4.7-node-v48-linux-arm.tar.gz
prebuild-install WARN install EACCES: permission denied, access '/root/.npm'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.11.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/node_modules/robotjs/.node-gyp"
make: Entering directory '/home/pi/node_modules/robotjs/build'
CXX(target) Release/obj.target/robotjs/src/robotjs.o
cc1plus: warning: command line option ‘-Wbad-function-cast’ is valid for C/ObjC but not for C++
../src/robotjs.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE keyToggle(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/robotjs.cc:563:35: warning: ‘down’ may be used uninitialized in this function [-Wmaybe-uninitialized]
toggleKeyCode(key, down, flags);
^
CC(target) Release/obj.target/robotjs/src/deadbeef_rand.o
CC(target) Release/obj.target/robotjs/src/mouse.o
../src/mouse.c:12:35: fatal error: X11/extensions/XTest.h: No such file or directory
#include
^
compilation terminated.
robotjs.target.mk:114: recipe for target 'Release/obj.target/robotjs/src/mouse.o' failed
make: * [Release/obj.target/robotjs/src/mouse.o] Error 1
make: Leaving directory '/home/pi/node_modules/robotjs/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.9.35+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/node_modules/robotjs
gyp ERR! node -v v6.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: prebuild-install || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! /root/.npm/_logs/2017-08-17T11_42_54_073Z-debug.log

Most helpful comment

edit: this fixes the error sudo apt-get install libxtst-dev libpng++-dev

All 3 comments

I got past the issue with #include by
sudo apt-get install libxtst-dev (see https://stackoverflow.com/questions/5073040/how-to-find-x11-extensions-xtest-h#5073075)

I still face the gyp errors.

edit: this fixes the error sudo apt-get install libxtst-dev libpng++-dev

This issue has been closed because it has been inactive for > 180 days.
You may reopen this issue if it has been closed in error.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

piyushpatil027 picture piyushpatil027  Â·  3Comments

EdSaleh picture EdSaleh  Â·  8Comments

HopefulLlama picture HopefulLlama  Â·  3Comments

saghul picture saghul  Â·  6Comments

poojas2288 picture poojas2288  Â·  5Comments