octalmage / pixelcolor

Get pixel color from screen.
30 stars 8 forks source link

npm install error on Ubuntu #1

Open Honghe opened 9 years ago

Honghe commented 9 years ago

env

➜ pixelcolor git:(master) ✗ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS Release: 14.04 Codename: trusty ➜ pixelcolor git:(master) ✗ uname -a Linux hh 3.13.0-62-generic #102-Ubuntu SMP Tue Aug 11 14:29:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Error

➜  pixelcolor git:(master) npm install
npm WARN package.json pixelcolor@0.0.1 No repository field.
|
> robotjs@0.2.4 install /home/hh/pixelcolor/node_modules/robotjs
> node-gyp rebuild

make: Entering directory `/home/hh/pixelcolor/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++ [enabled by default]
In file included from ../src/keypress.h:6:0,
                 from ../src/robotjs.cc:7:
../src/keycode.h:55:23: fatal error: X11/Xutil.h: No such file or directory
 #include <X11/Xutil.h>
                       ^
compilation terminated.
make: *** [Release/obj.target/robotjs/src/robotjs.o] Error 1
make: Leaving directory `/home/hh/pixelcolor/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:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.13.0-62-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/hh/pixelcolor/node_modules/robotjs
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok 
npm ERR! Linux 3.13.0-62-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! robotjs@0.2.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the robotjs@0.2.4 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the robotjs 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 robotjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/hh/pixelcolor/npm-debug.log
octalmage commented 9 years ago

Hi! Thanks for the report.

Could you try installing these packages?

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

I believe this should resolve the issue.

Honghe commented 9 years ago
➜  pixelcolor git:(master) ✗ node app.js       
module.js:338
    throw err;
          ^
Error: Cannot find module 'nw.gui'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/honghe/pixelcolor/app.js:2:11)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
Honghe commented 9 years ago

How to resolve the nw.gui dependency?

octalmage commented 9 years ago

This app needs to be ran with nw.js, there's a guide here:

https://github.com/nwjs/nw.js/wiki/How-to-run-apps

I'll package the app and upload it when I have time.