serialport / node-serialport

Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!
https://serialport.io
MIT License
5.82k stars 1.01k forks source link

node-gyp is not running on npm install #81

Closed trobrock closed 12 years ago

trobrock commented 12 years ago

I am trying to npm install serialport on a raspberry pi. The install looks successful, but there is not compilation output and the .node file is not generated. If I change into node_modules/serialport and run node-gyp rebuild things seem to work fine. What is it that is supposed to trigger the node-gyp compile?

zuk commented 12 years ago

https://github.com/voodootikigod/node-serialport/issues/79#issuecomment-8215513 might help depending on what distro you're running on your Pi.

trobrock commented 12 years ago

Yes I am running Raspbian, and manually compiling works for me, it just does not automatically build during the npm install.

rakeshpai commented 12 years ago

Let me know if I should file a separate issue for this, but since 81b66edfc6251eac45cef0f1ff02a19901e8bb6c (I'm guessing) manually compiling also fails with the following output:

gyp info it worked if it ends with ok gyp info using node-gyp@0.6.9 gyp info using node@0.6.19 | linux | arm gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory `/home/pi/Projects/car/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/build' CXX(target) Release/obj.target/serialport/src/serialport.o ../src/serialport.cpp:8:1: error: ‘uv_mutex_t’ does not name a type ../src/serialport.cpp: In function ‘v8::Handlev8::Value Open(const v8::Arguments&)’: ../src/serialport.cpp:14:18: error: ‘write_queue_mutex’ was not declared in this scope ../src/serialport.cpp:14:35: error: ‘uv_mutex_init’ was not declared in this scope ../src/serialport.cpp: In function ‘v8::Handlev8::Value Write(const v8::Arguments&)’: ../src/serialport.cpp:112:18: error: ‘write_queue_mutex’ was not declared in this scope ../src/serialport.cpp:112:35: error: ‘uv_mutex_lock’ was not declared in this scope ../src/serialport.cpp:120:37: error: ‘uv_mutex_unlock’ was not declared in this scope ../src/serialport.cpp: In function ‘void EIO_AfterWrite(uv_workt)’: ../src/serialport.cpp:139:18: error: ‘write_queue_mutex’ was not declared in this scope ../src/serialport.cpp:139:35: error: ‘uv_mutex_lock’ was not declared in this scope ../src/serialport.cpp:148:37: error: ‘uv_mutexunlock’ was not declared in this scope make: ** [Release/obj.target/serialport/src/serialport.o] Error 1

I'm guessing it's 81b66edfc6251eac45cef0f1ff02a19901e8bb6c because that's where uv_mutex_t changes were introduced.

voodootikigod commented 12 years ago

correct use version 1.0.6 for node < 0.7.0

On Sunday, September 23, 2012 at 10:45 AM, Rakesh Pai wrote:

Let me know if I should file a separate issue for this, but since 81b66ed (https://github.com/voodootikigod/node-serialport/commit/81b66edfc6251eac45cef0f1ff02a19901e8bb6c) (I'm guessing) manually compiling also fails with the following output: gyp info it worked if it ends with ok gyp info using node-gyp@0.6.9 (mailto:node-gyp@0.6.9) gyp info using node@0.6.19 (mailto:node@0.6.19) | linux | arm gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory `/home/pi/Projects/car/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/build' CXX(target) Release/obj.target/serialport/src/serialport.o ../src/serialport.cpp:8:1: error: ‘uv_mutex_t’ does not name a type ../src/serialport.cpp: In function ‘v8::Handlev8::Value Open(const v8::Arguments&)’: ../src/serialport.cpp:14:18: error: ‘write_queue_mutex’ was not declared in this scope ../src/serialport.cpp:14:35: error: ‘uv_mutex_init’ was not declared in this scope ../src/serialport.cpp: In function ‘v8::Handlev8::Value Write(const v8::Arguments&)’: ../src/serialport.cpp:112:18: error: ‘write_queue_mutex’ was not declared in this scope ../src/serialport.cpp:112:35: error: ‘uv_mutex_lock’ was not declared in this scope ../src/serialport.cpp:120:37: error: ‘uv_mutex_unlock’ was not declared in this scope ../src/serialport.cpp: In function ‘void EIO_AfterWrite(uv_work_t)’: ../src/serialport.cpp:139:18: error: ‘write_queue_mutex’ was not declared in this scope ../src/serialport.cpp:139:35: error: ‘uv_mutex_lock’ was not declared in this scope ../src/serialport.cpp:148:37: error: ‘uv_mutex_unlock’ was not declared in this scope make: \ [Release/obj.target/serialport/src/serialport.o] Error 1
I'm guessing it's 81b66ed (https://github.com/voodootikigod/node-serialport/commit/81b66edfc6251eac45cef0f1ff02a19901e8bb6c) because that's where uv_mutex_t changes were introduced.

— Reply to this email directly or view it on GitHub (https://github.com/voodootikigod/node-serialport/issues/81#issuecomment-8799088).

rakeshpai commented 12 years ago

Ah thanks. Sorry for hijacking this thread. Back to you, @trobrock

JayBeavers commented 12 years ago

I doubt that this is an issue with node-serialport itself, but rather with node-gyp / gyp. Can you try moving to the most recent version of nodejs by download and installing from the github source and using version v0.9.2 (most recent as of this writing)?

I know compiling nodejs on arm is painful, but I strongly suspect the problems are in the gyp / node-gyp code rather than anything specifically in this project and they seem to be making positive progress on more stable gyp with the latest builds.