Robotjs: install fails on ubuntu bionic beaver

Created on 18 Dec 2018  Â·  3Comments  Â·  Source: octalmage/robotjs

when i run npm install robotjs

$npm install robotjs

> [email protected] install /home/pg07codes/Desktop/check/node_modules/robotjs
> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=10.7.0 runtime=node arch=x64 platform=linux)
make: Entering directory '/home/pg07codes/Desktop/check/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++
In file included from ../src/robotjs.cc:2:0:
../../nan/nan.h: In constructor ‘Nan::Utf8String::Utf8String(v8::Local<v8::Value>)’:
../../nan/nan.h:1081:101: error: no matching function for call to ‘v8::String::WriteUtf8(v8::Isolate*, char*&, int, int, const int&)’
         length_ = string->WriteUtf8(v8::Isolate::GetCurrent(), str_, static_cast<int>(len), 0, flags);
                                                                                                     ^
In file included from /home/pg07codes/.node-gyp/10.7.0/include/node/node.h:63:0,
                 from ../src/robotjs.cc:1:
/home/pg07codes/.node-gyp/10.7.0/include/node/v8.h:2622:7: note: candidate: int v8::String::WriteUtf8(char*, int, int*, int) const
   int WriteUtf8(char* buffer,
       ^~~~~~~~~
/home/pg07codes/.node-gyp/10.7.0/include/node/v8.h:2622:7: note:   candidate expects 4 arguments, 5 provided
../src/robotjs.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE mouseClick(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/robotjs.cc:143:49: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
   v8::String::Utf8Value bstr(info[0]->ToString());
                                                 ^
In file included from /home/pg07codes/.node-gyp/10.7.0/include/node/v8.h:26:0,
                 from /home/pg07codes/.node-gyp/10.7.0/include/node/node.h:63,
                 from ../src/robotjs.cc:1:
/home/pg07codes/.node-gyp/10.7.0/include/node/v8.h:2852:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/home/pg07codes/.node-gyp/10.7.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/robotjs.cc: In function ‘int GetFlagsFromString(v8::Handle<v8::Value>, MMKeyFlags*)’:
../src/robotjs.cc:420:46: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
  v8::String::Utf8Value fstr(value->ToString());
                                              ^
In file included from /home/pg07codes/.node-gyp/10.7.0/include/node/v8.h:26:0,
                 from /home/pg07codes/.node-gyp/10.7.0/include/node/node.h:63,
                 from ../src/robotjs.cc:1:
/home/pg07codes/.node-gyp/10.7.0/include/node/v8.h:2852:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/home/pg07codes/.node-gyp/10.7.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/robotjs.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE keyTap(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/robotjs.cc:457:48: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
  v8::String::Utf8Value kstr(info[0]->ToString());
                                                ^
In file included from /home/pg07codes/.node-gyp/10.7.0/include/node/v8.h:26:0,
                 from /home/pg07codes/.node-gyp/10.7.0/include/node/node.h:63,
                 from ../src/robotjs.cc:1:
/home/pg07codes/.node-gyp/10.7.0/include/node/v8.h:2852:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/home/pg07codes/.node-gyp/10.7.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
robotjs.target.mk:114: recipe for target 'Release/obj.target/robotjs/src/robotjs.o' failed
make: *** [Release/obj.target/robotjs/src/robotjs.o] Error 1
make: Leaving directory '/home/pg07codes/Desktop/check/node_modules/robotjs/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/pg07codes/.nvm/versions/node/v10.7.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.15.0-42-generic
gyp ERR! command "/home/pg07codes/.nvm/versions/node/v10.7.0/bin/node" "/home/pg07codes/.nvm/versions/node/v10.7.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pg07codes/Desktop/check/node_modules/robotjs
gyp ERR! node -v v10.7.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN [email protected] No description
npm WARN [email protected] No repository 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!     /home/pg07codes/.npm/_logs/2018-12-18T06_45_29_060Z-debug.log

it can be a possible issue with node-gyp as when i run node-gyp rebuild

$node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/home/pg07codes/.nvm/versions/node/v10.7.0/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pg07codes/Desktop/check/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pg07codes/.nvm/versions/node/v10.7.0/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pg07codes/.node-gyp/10.7.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/pg07codes/.node-gyp/10.7.0',
gyp info spawn args   '-Dnode_gyp_dir=/home/pg07codes/.nvm/versions/node/v10.7.0/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/pg07codes/.node-gyp/10.7.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/pg07codes/Desktop/check',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: /home/pg07codes/Desktop/check) 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 (/home/pg07codes/.nvm/versions/node/v10.7.0/lib/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.15.0-42-generic
gyp ERR! command "/home/pg07codes/.nvm/versions/node/v10.7.0/bin/node" "/home/pg07codes/.nvm/versions/node/v10.7.0/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pg07codes/Desktop/check
gyp ERR! node -v v10.7.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

environment

  • node - 10.7.0
  • ubuntu- 18.04
  • robot - latest

ANY HELP IS HIGHLY APPRECIATED :smile:

Most helpful comment

Actually I just managed to get it working, I had to install these packaged:

sudo apt-get install libxtst-dev libpng++-dev

Found this here

All 3 comments

Same here on Ubuntu 16

Actually I just managed to get it working, I had to install these packaged:

sudo apt-get install libxtst-dev libpng++-dev

Found this here

@Ranguna i had already tried this before.
closing this issue as after a software update, npm install robotjs works for me fine.

Was this page helpful?
0 / 5 - 0 ratings