colinbdclark / osc.js-examples

Sample code illustrating how to use osc.js in a variety of scenarios.
104 stars 28 forks source link

Installing osc without the serialport module #17

Closed djipco closed 4 years ago

djipco commented 4 years ago

I have an OSC project that has been running inside NW.js on my Mac for quite a while. Now, I need to port it to Linux and I just cannot get it to work properly. I always get stuck on a serialport-related error.

I should mention that native libraries need to be specifically recompiled in order to work inside NW.js. I successfully did that a few years ago when the project started (on macOS) but I am unable to do it now.

This is the error I'm getting:

/home/jpcote/.cache/node-gyp/13.5.0/include/node/v8.h:3550:37: note:   candidate expects 3 arguments, 2 provided
bindings.target.mk:112: recipe for target 'Release/obj.target/bindings/src/serialport.o' failed
make: *** [Release/obj.target/bindings/src/serialport.o] Error 1
make: Leaving directory '/home/jpcote/test2/node_modules/osc/node_modules/@serialport/bindings/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:305:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.0.0-37-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/jpcote/test2/node_modules/osc/node_modules/@serialport/bindings
gyp ERR! node -v v13.5.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 

Since I am using OSC over WebSockets, is it possible to install osc without having to install serialport ?

colinbdclark commented 4 years ago

The serialport is an optional dependency, meaning the build process shouldn't fail if it can't be installed. There was, however, a bug in the previous version of osc.js that always tried to load it, even if it wasn't installed. If you upgrade to version 2.4.0, that issue should be fixed.

colinbdclark commented 4 years ago

By the way, if you encounter a bug with osc.js itself, you can file an issue on the osc.js repository issue tracker. And I'm always happy to take pull requests, fixes, and help—I do this entirely in spare time, at the cost of time with family and art-making.

djipco commented 4 years ago

There was, however, a bug in the previous version of osc.js that always tried to load it, even if it wasn't installed. If you upgrade to version 2.4.0, that issue should be fixed.

Ok, awesome. I will give it a try and get back to you with my results.

By the way, if you encounter a bug with osc.js itself, you can file an issue on the osc.js repository issue tracker.

Sorry about that. I didn't realize that I wasn't on the main osc repo.

And I'm always happy to take pull requests, fixes, and help—I do this entirely in spare time, at the cost of time with family and art-making.

Being a project maintainer myself, I totally understand where you are coming from. Believe me when I say that I truly appreciate the time and care you put into this project.

Cheers!