Jitsi-Electron - NPM Install Error

Hi,

Me again :man_facepalming:

When I built my development environment for jitsi-meet, i didn’t have any issues about “npm install”, but regarding to jitsi-meet-electron, it’s completely the opposite…

I searched on internet and I found many posts on Github, Jitsi forum, but nothing positive.

In /home/test/jitsi-meet/jitsi-meet-electron : “npm install”

npm install

> robotjs@0.4.7 install /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs
> node-gyp rebuild

make : on entre dans le répertoire « /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/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/keypress.h:6:0,
                 from ../src/robotjs.cc:7:
../src/keycode.h:103:10: fatal error: X11/Xutil.h: Aucun fichier ou dossier de ce type
 #include <X11/Xutil.h>
          ^~~~~~~~~~~~~
compilation terminated.
robotjs.target.mk:120: recipe for target 'Release/obj.target/robotjs/src/robotjs.o' failed
make: *** [Release/obj.target/robotjs/src/robotjs.o] Error 1
make : on quitte le répertoire « /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.18.0-18-generic
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! robotjs@0.4.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the robotjs@0.4.7 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/test/.npm/_logs/2019-05-02T14_45_21_729Z-debug.log

With (–verbose) :

npm install --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/local/bin/npm', 'install', '--verbose' ]
npm info using npm@6.9.0
npm info using node@v10.15.3
npm verb npm-session 87d124c451627c47
npm info lifecycle jitsi-meet-electron@1.1.1~preinstall: jitsi-meet-electron@1.1.1
npm timing stage:loadCurrentTree Completed in 2089ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 22ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 1204ms
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 5035ms
npm timing stage:loadIdealTree Completed in 6772ms
npm timing stage:generateActionsToTake Completed in 143ms
npm verb correctMkdir /home/test/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /home/test/.npm/_locks/staging-094ae4d172f5787f.lock for /home/test/jitsi-meet/jitsi-meet-electron/node_modules/.staging
npm timing action:extract Completed in 447ms
npm timing action:finalize Completed in 84ms
npm timing action:refresh-package-json Completed in 177ms
npm info lifecycle robotjs@0.4.7~preinstall: robotjs@0.4.7
npm info lifecycle jitsi-meet-electron-utils@github:jitsi/jitsi-meet-electron-utils#1972c3bf0884ace68eb496894dabae593d6dbf49~preinstall: jitsi-meet-electron-utils@github:jitsi/jitsi-meet-electron-utils#1972c3bf0884ace68eb496894dabae593d6dbf49
npm timing action:preinstall Completed in 1ms
npm info linkStuff robotjs@0.4.7
npm info linkStuff jitsi-meet-electron-utils@github:jitsi/jitsi-meet-electron-utils#1972c3bf0884ace68eb496894dabae593d6dbf49
npm timing action:build Completed in 5ms
npm info lifecycle robotjs@0.4.7~install: robotjs@0.4.7

> robotjs@0.4.7 install /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/node',
gyp verb cli   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild' ]
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.15
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 10.15.3
gyp verb command install [ '10.15.3' ]
gyp verb install input version string "10.15.3"
gyp verb install installing version: 10.15.3
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 10.15.3
gyp verb build dir attempting to create "build" dir: /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs/build
gyp verb build dir "build" dir needed to be created? /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs/build/config.gypi
gyp verb config.gypi checking for gypi file: /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs/config.gypi
gyp verb common.gypi checking for gypi file: /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/local/lib/node_modules/npm/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/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/test/.node-gyp/10.15.3/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/test/.node-gyp/10.15.3',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/test/.node-gyp/10.15.3/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs',
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 verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /home/test/.node-gyp/10.15.3
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make : on entre dans le répertoire « /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs/build »
  g++ '-DNODE_GYP_MODULE_NAME=robotjs' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/test/.node-gyp/10.15.3/include/node -I/home/test/.node-gyp/10.15.3/src -I/home/test/.node-gyp/10.15.3/deps/openssl/config -I/home/test/.node-gyp/10.15.3/deps/openssl/openssl/include -I/home/test/.node-gyp/10.15.3/deps/uv/include -I/home/test/.node-gyp/10.15.3/deps/zlib -I/home/test/.node-gyp/10.15.3/deps/v8/include -I../../../../nan  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/robotjs/src/robotjs.o.d.raw   -c -o Release/obj.target/robotjs/src/robotjs.o ../src/robotjs.cc
cc1plus: warning: command line option ‘-Wbad-function-cast’ is valid for C/ObjC but not for C++
In file included from ../src/keypress.h:6:0,
                 from ../src/robotjs.cc:7:
../src/keycode.h:103:10: fatal error: X11/Xutil.h: Aucun fichier ou dossier de ce type
 #include <X11/Xutil.h>
          ^~~~~~~~~~~~~
compilation terminated.
robotjs.target.mk:120: recipe for target 'Release/obj.target/robotjs/src/robotjs.o' failed
make: *** [Release/obj.target/robotjs/src/robotjs.o] Error 1
make : on quitte le répertoire « /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.18.0-18-generic
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm verb lifecycle robotjs@0.4.7~install: unsafe-perm in lifecycle truenpm verb lifecycle robotjs@0.4.7~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs/node_modules/.bin:/home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/.bin:/home/test/jitsi-meet/jitsi-meet-electron/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
npm verb lifecycle robotjs@0.4.7~install: CWD: /home/test/jitsi-meet/jitsi-meet-electron/node_modules/jitsi-meet-electron-utils/node_modules/robotjs
npm timing audit submit Completed in 1081ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 1081ms
npm timing audit body Completed in 2ms
npm info lifecycle robotjs@0.4.7~install: Failed to exec install scriptnpm timing action:install Completed in 792ms
npm verb unlock done using /home/test/.npm/_locks/staging-094ae4d172f5787f.lock for /home/test/jitsi-meet/jitsi-meet-electron/node_modules/.staging
npm timing stage:rollbackFailedOptional Completed in 122ms
npm timing stage:runTopLevelLifecycles Completed in 11186ms
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64

npm verb stack Error: robotjs@0.4.7 install: `node-gyp rebuild`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
npm verb stack     at EventEmitter.emit (events.js:189:13)
npm verb stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:189:13)
npm verb stack     at maybeClose (internal/child_process.js:970:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
npm verb pkgid robotjs@0.4.7
npm verb cwd /home/test/jitsi-meet/jitsi-meet-electron
npm verb Linux 4.18.0-18-generic
npm verb argv "/usr/bin/node" "/usr/local/bin/npm" "install" "--verbose"
npm verb node v10.15.3
npm verb npm  v6.9.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! robotjs@0.4.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the robotjs@0.4.7 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 12400ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/test/.npm/_logs/2019-05-02T14_50_57_982Z-debug.log

Thank you,
Yann

There are some issues in robotjs github that say you need to install the build dependencies of robotjs to get it work on linux. https://github.com/octalmage/robotjs#building. Based on the issues reported it might be you’re missing libxtst-dev.

You need to install the extra dependencies: sudo apt-get install libxtst-dev libpng++-dev

That should take of it.

It’s working, thank you.

For people who try to run “npm start” but it doesn’t work because of “electron”, do not hesitate to delete “node_modules” (rm -rf node_modules), and reinstall npm (npm install).

Yann.