Coder Social home page Coder Social logo

node-unix-dgram's Introduction

node-unix-dgram

Communicate over UNIX datagram sockets.

Usage

Server:

// One-shot server.  Note that the server cannot send a reply;
// UNIX datagram sockets are unconnected and the client is not addressable.
var unix = require('unix-dgram');
var server = unix.createSocket('unix_dgram', function(buf) {
  console.log('received ' + buf);
  server.close();
});
server.bind('/path/to/socket');

Client:

// Send a single message to the server.
var message = Buffer('ping');
var client = unix.createSocket('unix_dgram');
client.on('error', console.error);
client.send(message, 0, message.length, '/path/to/socket');
client.close();

API

Caveat emptor: events and callbacks are synchronous for efficiency reasons.

unix.createSocket(type, [listener])

Returns a new unix.Socket object. type should be 'unix_dgram'. Throws an exception if the socket(2) system call fails.

The optional listener argument is added as a listener for the 'message' event. The event listener receives the message as a Buffer object as its first argument.

socket.bind(path)

Create a server at path. Emits a 'listening' event on success or an 'error' event if the bind(2) system call fails.

socket.connect(remote_path)

Associate a socket with a remote path so you can send a message without setting the remote path. Once the socket is connected it emits a 'connect' event. It also allows to perform some kind of congestion control as it emits a 'congestion' event when the receiving buffer is full, and a 'writable' event when it stops being full.

socket.send(buf, [callback])

Only to be used with connected sockets. It sends a message to the remote path associated with the socket

Example:

var unix = require('unix-dgram');

var client = unix.createSocket('unix_dgram');

client.on('error', function(err) {
    console.error(err);
});

client.on('connect', function() {
    console.log('connected');
    client.on('congestion', function() {
        console.log('congestion');
        /* The server is not accepting data */
    });

    client.on('writable', function() {
        console.log('writable');
        /* The server can accept data */
    });

    var message = new Buffer('PING');
    client.send(message);
});

client.connect('/tmp/server');

socket.send_to(buf, offset, length, path, [callback]);

Send a message to the server listening at path.

buf is a Buffer object containing the message to send, offset is the offset into the buffer and length is the length of the message.

For backwards compatibility, you can still use the socket.send function with this same signature.

Example:

var buf = new Buffer('foobarbaz');
socket.send(buf, 3, 4, '/path/to/socket');  // Sends 'barb'.

socket.close()

Close the socket. If the socket was bound to a path with socket.bind(), then you will no longer receive new messages. The file system entity (the socket file) is not automatically unlinked.

node-unix-dgram's People

Contributors

bnoordhuis avatar dabh avatar jbdemonte avatar papandreou avatar pcarrier avatar rohiniwork avatar rvagg avatar santigimeno avatar witem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-unix-dgram's Issues

Failing to build (ubuntu 20.04)

I may be doing something very wrong, but it doesn't seem to build :

magnayn@Quordlepleen:~/node-unix-dgram$ npm i

> [email protected] install /home/magnayn/node-unix-dgram
> node-gyp rebuild

make: Entering directory '/home/magnayn/node-unix-dgram/build'
  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
In file included from /usr/include/x86_64-linux-gnu/sys/stat.h:446,
                 from /home/magnayn/.cache/node-gyp/14.5.0/include/node/uv/unix.h:26,
                 from /home/magnayn/.cache/node-gyp/14.5.0/include/node/uv.h:66,
                 from ../node_modules/nan/nan.h:55,
                 from ../src/unix_dgram.cc:5:
/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed/bits/statx.h:38:25: error: missing binary operator before token "("
   38 | #if __glibc_has_include ("__linux__/stat.h")
      |                         ^
In file included from ../src/unix_dgram.cc:5:
../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../node_modules/nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
In file included from ../node_modules/nan/nan.h:56,
                 from ../src/unix_dgram.cc:5:
../src/unix_dgram.cc: At global scope:
/home/magnayn/.cache/node-gyp/14.5.0/include/node/node.h:738:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  738 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/home/magnayn/.cache/node-gyp/14.5.0/include/node/node.h:772:3: note: in expansion of macro ‘NODE_MODULE_X’
  772 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/unix_dgram.cc:404:1: note: in expansion of macro ‘NODE_MODULE’
  404 | NODE_MODULE(unix_dgram, Initialize)
      | ^~~~~~~~~~~
make: *** [unix_dgram.target.mk:111: Release/obj.target/unix_dgram/src/unix_dgram.o] Error 1
make: Leaving directory '/home/magnayn/node-unix-dgram/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/magnayn/.nvm/versions/node/v14.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.4.0-31-generic
gyp ERR! command "/home/magnayn/.nvm/versions/node/v14.5.0/bin/node" "/home/magnayn/.nvm/versions/node/v14.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/magnayn/node-unix-dgram
gyp ERR! node -v v14.5.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] 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/magnayn/.npm/_logs/2020-07-16T14_38_51_921Z-debug.log

Various versions:

magnayn@Quordlepleen:~/node-unix-dgram$ node -v
v14.5.0
magnayn@Quordlepleen:~/node-unix-dgram$ npm -v
6.14.5
magnayn@Quordlepleen:~/node-unix-dgram$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.2.1-9ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2)

getting a "make" error when building on CentOS 7

I'm using a library called winston-syslog that requires your library as a dependency. When running node-gyp rebuild, make gets an error.

FYI I have all the Development Tools installed.

$ 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 python2
gyp info spawn args [ '/usr/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   '/root/node-unix-dgram/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.node-gyp/0.11.14/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.node-gyp/0.11.14',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=/root/node-unix-dgram',
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 info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/root/node-unix-dgram/build'
  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
In file included from ../src/unix_dgram.cc:5:
../node_modules/nan/nan.h: In function 'void Nan::SetCounterFunction(int* (*)(const char*))':
../node_modules/nan/nan.h:447: error: 'class v8::Isolate' has no member named 'SetCounterFunction'
../node_modules/nan/nan.h: In function 'void Nan::SetCreateHistogramFunction(void* (*)(const char*, int, int, size_t))':
../node_modules/nan/nan.h:452: error: 'class v8::Isolate' has no member named 'SetCreateHistogramFunction'
../node_modules/nan/nan.h: In function 'void Nan::SetAddHistogramSampleFunction(void (*)(void*, int))':
../node_modules/nan/nan.h:457: error: 'class v8::Isolate' has no member named 'SetAddHistogramSampleFunction'
../node_modules/nan/nan.h: In function 'bool Nan::IdleNotification(int)':
../node_modules/nan/nan.h:468: error: 'class v8::Isolate' has no member named 'IdleNotification'
../node_modules/nan/nan.h: In function 'void Nan::LowMemoryNotification()':
../node_modules/nan/nan.h:473: error: 'class v8::Isolate' has no member named 'LowMemoryNotification'
../node_modules/nan/nan.h: In function 'void Nan::ContextDisposedNotification()':
../node_modules/nan/nan.h:477: error: 'class v8::Isolate' has no member named 'ContextDisposedNotification'
make: *** [Release/obj.target/unix_dgram/src/unix_dgram.o] Error 1
make: Leaving directory `/root/node-unix-dgram/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/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1059:12)
gyp ERR! System Linux 2.6.32-504.16.2.el6.x86_64
gyp ERR! command "node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /root/node-unix-dgram
gyp ERR! node -v v0.11.14
gyp ERR! node-gyp -v v3.1.0
gyp ERR! not ok

Sending data in loop fails

Sending data in loop fails,
It seems to be required to add en arbitrary setTimeout to delay the write. I also tried to use process.nextTick, but it didn't fix)

(fyi, on my side, I'm using a python code for the server and get the same fails)

server.js

  var unix = require('unix-dgram');
  var fs = require('fs');
  var socketPath = __dirname + '/test.socket';
  
  if (fs.existsSync(socketPath)) {
    fs.unlink(socketPath);
  }
  
  var server = unix.createSocket('unix_dgram', function (buf) {
    console.log('received: ' + buf);
  });
  
  server.bind(socketPath);

client.js

var unix = require('unix-dgram');
var client = unix.createSocket('unix_dgram');
var socketPath = __dirname + '/test.socket';

client.on('error', function (err) {
  console.error(err);
  client.close();
});

var i=0, message;

/**/
for (i = 0; i < 1000; i++) {
  message = Buffer.from('message ' + i);
  client.send(message, 0, message.length, socketPath);
}
client.close();
/**/


/** /
// this code works thanks to the setTimeout
function send() {
  i++;
  var message = Buffer.from('message ' + i);
  client.send(message, 0, message.length, socketPath);
  if (i < 1000) {
    setTimeout(send, 10);
  } else {
    client.close();
  }
}
send();
/**/

Here is the error on my mac laptop:

jbd:~/git/lala$ node client.js
{ [Error: send -55] code: -55, errno: -55, syscall: 'send' }
{ [Error: send -9] code: -9, errno: -9, syscall: 'send' }
Assertion failed: (iter != watchers.end()), function StopWatcher, file ../src/unix_dgram.cc, line 166.

Here is the error on my debian server:

jbd@beta:~/test_socket$ node client.js
{ Error: send -11
  at errnoException (/home/jbd/test_socket/node_modules/unix-dgram/lib/unix_dgram.js:18:11)
  at Socket.send (/home/jbd/test_socket/node_modules/unix-dgram/lib/unix_dgram.js:93:17)
  at Object.<anonymous> (/home/jbd/test_socket/client.js:15:10)
  at Module._compile (module.js:571:32)
  at Object.Module._extensions..js (module.js:580:10)
  at Module.load (module.js:488:32)
  at tryModuleLoad (module.js:447:12)
  at Function.Module._load (module.js:439:3)
  at Module.runMain (module.js:605:10)
  at run (bootstrap_node.js:420:7) code: -11, errno: -11, syscall: 'send' }
{ Error: send -9
  at errnoException (/home/jbd/test_socket/node_modules/unix-dgram/lib/unix_dgram.js:18:11)
  at Socket.send (/home/jbd/test_socket/node_modules/unix-dgram/lib/unix_dgram.js:93:17)
  at Object.<anonymous> (/home/jbd/test_socket/client.js:15:10)
  at Module._compile (module.js:571:32)
  at Object.Module._extensions..js (module.js:580:10)
  at Module.load (module.js:488:32)
  at tryModuleLoad (module.js:447:12)
  at Function.Module._load (module.js:439:3)
  at Module.runMain (module.js:605:10)
  at run (bootstrap_node.js:420:7) code: -9, errno: -9, syscall: 'send' }
node: ../src/unix_dgram.cc:166: void {anonymous}::StopWatcher(int): Assertion `iter != watchers.end()' failed.

does not work on node 4 or node 5

server.js pid 12484
/usr/lib/node_modules/unix-dgram/node_modules/bindings/bindings.js:83
throw e
^

Error: Module did not self-register.
at Error (native)
at Object.Module._extensions..node (module.js:450:18)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at bindings (/usr/lib/node_modules/unix-dgram/node_modules/bindings/bindings.js:76:44)
at Object. (/usr/lib/node_modules/unix-dgram/lib/unix_dgram.js:4:34)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)

This occures when I do require('unix-dgram');
I've looked inside bindings.js - it does find binary file node_modules/unix-dgram/build/Release/unix_dgram.node but tells that module is not registered.

No buffer space available, write errror

I'm working on a project that uses unix_dgram. My app sends data to a Unix socket. I'm using unix_dgram to create the socket and read the incoming messages. From within node, I don't get any errors from your application, but my producer app that's pushing data on the socket create by unix_dgram lib complains about there is no buffer space available.

I'm pushing a lot of data through this socket, so a lot of the data get through fine, it's only a few messages that don't come out the other end.

Write error on Unix socket "/tmp/demo.socket": No buffer space available;

Do you know how I can make the buffer size larger within this lib or any methods for me to resolve this issue?

Thanks in advance.

Nan::NAN_METHOD_RETURN_TYPE

hi, there, i use this plugin to send buffer with a sock file, but encount error:

node: ../src/unix_dgram.cc:299: Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Send(Nan::NAN_METHOD_ARGS_TYPE): Assertion `node::Buffer::HasInstance(buf)' failed.

is there anyone know why?

bad buffer on mac

Running the test I get the following:

$ node test-dgram-unix.js 
client send {}
server recv { '0': <SlowBuffer 50 49 4e 47 00 00 00 60 00 00 00 00 00 00 00 60 02 00 72 1a>,
  '1': { size: 20, address: {} } }

assert.js:102
  throw new assert.AssertionError({
        ^
AssertionError: "PING\u0000\u0000\u0000`\u0000\u0000\u0000\u0000\u0000\u0000\u0000`\u0002\u0000r\u001a" == "PING"
    at Socket.<anonymous> (/Users/pooya/code/modules/ain/node_modules/unix-dgram/test/test-dgram-unix.js:19:10)
    at Socket.EventEmitter.emit (events.js:91:17)
    at Socket.recv (/Users/pooya/code/modules/ain/node_modules/unix-dgram/src/unix_dgram.js:37:8)

Tried to update ain2 to use this, but got segfaults and "bus error: 10".

unix-dgram does not seem to work with Node v13?

I tried installing this today and it's just throwing build errors for me. Any suggestions would be great.

`npm i unix-dgram` logs
root@Devon:/usr/local/node/test# npm i unix-dgram

> [email protected] install /usr/local/node/test/node_modules/unix-dgram
> node-gyp rebuild

gyp WARN EACCES current user ("xo") does not have permission to access the dev dir "/root/.cache/node-gyp/13.12.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/node/test/node_modules/unix-dgram/.node-gyp"
make: Entering directory '/usr/local/node/test/node_modules/unix-dgram/build'
  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
In file included from ../src/unix_dgram.cc:5:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
In file included from ../../nan/nan.h:56,
                 from ../src/unix_dgram.cc:5:
../src/unix_dgram.cc: At global scope:
/usr/local/node/test/node_modules/unix-dgram/.node-gyp/13.12.0/include/node/node.h:618:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/usr/local/node/test/node_modules/unix-dgram/.node-gyp/13.12.0/include/node/node.h:652:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/unix_dgram.cc:404:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(unix_dgram, Initialize)
 ^~~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/unix_dgram.node
/usr/bin/ld: cannot find /usr/lib64/libmvec_nonshared.a
collect2: error: ld returned 1 exit status
make: *** [unix_dgram.target.mk:135: Release/obj.target/unix_dgram.node] Error 1
make: Leaving directory '/usr/local/node/test/node_modules/unix-dgram/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib64/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.6.18-Unraid
gyp ERR! command "/usr/bin/node" "/usr/lib64/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/node/test/node_modules/unix-dgram
gyp ERR! node -v v13.12.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/usr/local/node/test/package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] 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!     /root/.npm/_logs/2020-07-08T04_13_50_105Z-debug.log
Full debug logs
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'i', 'unix-dgram' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 1cbc9fa792d44acc
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/unix-dgram 260ms (from cache)
8 silly pacote tag manifest for unix-dgram@latest fetched in 283ms
9 timing stage:loadCurrentTree Completed in 342ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 3ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule [email protected] checking installable status
17 http fetch GET 304 https://registry.npmjs.org/bindings 909ms (from cache)
18 http fetch GET 304 https://registry.npmjs.org/nan 909ms (from cache)
19 silly pacote range manifest for bindings@^1.3.0 fetched in 918ms
20 silly resolveWithNewModule [email protected] checking installable status
21 silly pacote range manifest for nan@^2.13.2 fetched in 916ms
22 silly resolveWithNewModule [email protected] checking installable status
23 http fetch GET 304 https://registry.npmjs.org/file-uri-to-path 868ms (from cache)
24 silly pacote version manifest for [email protected] fetched in 881ms
25 silly resolveWithNewModule [email protected] checking installable status
26 timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 1820ms
27 timing stage:loadIdealTree Completed in 1830ms
28 silly currentTree test
29 silly idealTree test
29 silly idealTree ├── [email protected]
29 silly idealTree ├── [email protected]
29 silly idealTree ├── [email protected]
29 silly idealTree └── [email protected]
30 silly install generateActionsToTake
31 timing stage:generateActionsToTake Completed in 15ms
32 silly diffTrees action count 4
33 silly diffTrees add [email protected]
34 silly diffTrees add [email protected]
35 silly diffTrees add [email protected]
36 silly diffTrees add [email protected]
37 silly decomposeActions action count 32
38 silly decomposeActions fetch [email protected]
39 silly decomposeActions extract [email protected]
40 silly decomposeActions preinstall [email protected]
41 silly decomposeActions build [email protected]
42 silly decomposeActions install [email protected]
43 silly decomposeActions postinstall [email protected]
44 silly decomposeActions finalize [email protected]
45 silly decomposeActions refresh-package-json [email protected]
46 silly decomposeActions fetch [email protected]
47 silly decomposeActions extract [email protected]
48 silly decomposeActions preinstall [email protected]
49 silly decomposeActions build [email protected]
50 silly decomposeActions install [email protected]
51 silly decomposeActions postinstall [email protected]
52 silly decomposeActions finalize [email protected]
53 silly decomposeActions refresh-package-json [email protected]
54 silly decomposeActions fetch [email protected]
55 silly decomposeActions extract [email protected]
56 silly decomposeActions preinstall [email protected]
57 silly decomposeActions build [email protected]
58 silly decomposeActions install [email protected]
59 silly decomposeActions postinstall [email protected]
60 silly decomposeActions finalize [email protected]
61 silly decomposeActions refresh-package-json [email protected]
62 silly decomposeActions fetch [email protected]
63 silly decomposeActions extract [email protected]
64 silly decomposeActions preinstall [email protected]
65 silly decomposeActions build [email protected]
66 silly decomposeActions install [email protected]
67 silly decomposeActions postinstall [email protected]
68 silly decomposeActions finalize [email protected]
69 silly decomposeActions refresh-package-json [email protected]
70 silly install executeActions
71 silly doSerial global-install 32
72 verbose correctMkdir /root/.npm/_locks correctMkdir not in flight; initializing
73 verbose lock using /root/.npm/_locks/staging-dab8d8b0622040e5.lock for /usr/local/node/test/node_modules/.staging
74 silly doParallel extract 4
75 silly extract [email protected]
76 silly extract [email protected]
77 silly extract [email protected]
78 silly extract [email protected]
79 silly tarball trying [email protected] by hash: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
80 silly tarball trying bindings@^1.3.0 by hash: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
81 silly tarball trying nan@^2.13.2 by hash: sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==
82 silly tarball trying unix-dgram@latest by hash: sha512-7tpK6x7ls7J7pDrrAU63h93R0dVhRbPwiRRCawR10cl+2e1VOvF3bHlVJc6WI1dl/8qk5He673QU+Ogv7bPNaw==
83 silly extract bindings@^1.3.0 extracted to /usr/local/node/test/node_modules/.staging/bindings-d2564960 (81ms)
84 silly extract [email protected] extracted to /usr/local/node/test/node_modules/.staging/file-uri-to-path-732ccd94 (86ms)
85 silly extract unix-dgram@latest extracted to /usr/local/node/test/node_modules/.staging/unix-dgram-5e2cc840 (86ms)
86 silly extract nan@^2.13.2 extracted to /usr/local/node/test/node_modules/.staging/nan-8a3b6272 (102ms)
87 timing action:extract Completed in 107ms
88 silly doReverseSerial unbuild 32
89 silly doSerial remove 32
90 silly doSerial move 32
91 silly doSerial finalize 32
92 silly finalize /usr/local/node/test/node_modules/file-uri-to-path
93 silly finalize /usr/local/node/test/node_modules/bindings
94 silly finalize /usr/local/node/test/node_modules/nan
95 silly finalize /usr/local/node/test/node_modules/unix-dgram
96 timing action:finalize Completed in 14ms
97 silly doParallel refresh-package-json 4
98 silly refresh-package-json /usr/local/node/test/node_modules/file-uri-to-path
99 silly refresh-package-json /usr/local/node/test/node_modules/bindings
100 silly refresh-package-json /usr/local/node/test/node_modules/nan
101 silly refresh-package-json /usr/local/node/test/node_modules/unix-dgram
102 timing action:refresh-package-json Completed in 39ms
103 silly doParallel preinstall 4
104 silly preinstall [email protected]
105 info lifecycle [email protected]~preinstall: [email protected]
106 silly preinstall [email protected]
107 info lifecycle [email protected]~preinstall: [email protected]
108 silly preinstall [email protected]
109 info lifecycle [email protected]~preinstall: [email protected]
110 silly preinstall [email protected]
111 info lifecycle [email protected]~preinstall: [email protected]
112 timing action:preinstall Completed in 3ms
113 silly doSerial build 32
114 silly build [email protected]
115 info linkStuff [email protected]
116 silly linkStuff [email protected] has /usr/local/node/test/node_modules as its parent node_modules
117 silly build [email protected]
118 info linkStuff [email protected]
119 silly linkStuff [email protected] has /usr/local/node/test/node_modules as its parent node_modules
120 silly build [email protected]
121 info linkStuff [email protected]
122 silly linkStuff [email protected] has /usr/local/node/test/node_modules as its parent node_modules
123 silly build [email protected]
124 info linkStuff [email protected]
125 silly linkStuff [email protected] has /usr/local/node/test/node_modules as its parent node_modules
126 timing action:build Completed in 4ms
127 silly doSerial global-link 32
128 silly doParallel update-linked 0
129 silly doSerial install 32
130 silly install [email protected]
131 info lifecycle [email protected]~install: [email protected]
132 silly install [email protected]
133 info lifecycle [email protected]~install: [email protected]
134 silly install [email protected]
135 info lifecycle [email protected]~install: [email protected]
136 silly install [email protected]
137 info lifecycle [email protected]~install: [email protected]
138 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle false
139 verbose lifecycle [email protected]~install: PATH: /usr/lib64/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/node/test/node_modules/unix-dgram/node_modules/.bin:/usr/local/node/test/node_modules/.bin:.:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
140 verbose lifecycle [email protected]~install: CWD: /usr/local/node/test/node_modules/unix-dgram
141 silly lifecycle [email protected]~install: Args: [ '-c', 'node-gyp rebuild' ]
142 timing audit submit Completed in 862ms
143 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 862ms
144 timing audit body Completed in 1ms
145 silly lifecycle [email protected]~install: Returned: code: 1  signal: null
146 info lifecycle [email protected]~install: Failed to exec install script
147 timing action:install Completed in 4242ms
148 verbose unlock done using /root/.npm/_locks/staging-dab8d8b0622040e5.lock for /usr/local/node/test/node_modules/.staging
149 timing stage:rollbackFailedOptional Completed in 255ms
150 timing stage:runTopLevelLifecycles Completed in 6889ms
151 silly saveTree test
151 silly saveTree └─┬ [email protected]
151 silly saveTree   ├─┬ [email protected]
151 silly saveTree   │ └── [email protected]
151 silly saveTree   └── [email protected]
152 warn enoent ENOENT: no such file or directory, open '/usr/local/node/test/package.json'
153 verbose enoent This is related to npm not being able to find a file.
154 warn test No description
155 warn test No repository field.
156 warn test No README data
157 warn test No license field.
158 verbose stack Error: [email protected] install: `node-gyp rebuild`
158 verbose stack Exit status 1
158 verbose stack     at EventEmitter.<anonymous> (/usr/lib64/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
158 verbose stack     at EventEmitter.emit (events.js:315:20)
158 verbose stack     at ChildProcess.<anonymous> (/usr/lib64/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
158 verbose stack     at ChildProcess.emit (events.js:315:20)
158 verbose stack     at maybeClose (internal/child_process.js:1026:16)
158 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
159 verbose pkgid [email protected]
160 verbose cwd /usr/local/node/test
161 verbose Linux 5.6.18-Unraid
162 verbose argv "/usr/bin/node" "/usr/bin/npm" "i" "unix-dgram"
163 verbose node v13.12.0
164 verbose npm  v6.14.4
165 error code ELIFECYCLE
166 error errno 1
167 error [email protected] install: `node-gyp rebuild`
167 error Exit status 1
168 error Failed at the [email protected] install script.
168 error This is probably not a problem with npm. There is likely additional logging output above.
169 verbose exit [ 1, true ]

Buffer limited to 2048 on Mac OS

Hi,

I'm facing a strange limitation I failed to bypass, on my mac, this code fail when the Buffer length is over 2048 with error -40 while on debian it fails over 212960 with error -90

var fs = require('fs');
var socketPath = __dirname + '/test.socket';

var unix = require('unix-dgram');
var server = unix.createSocket('unix_dgram', function(buf) {
  console.log('received ' + buf);
  server.close();
  fs.unlink(socketPath);
});
server.bind(socketPath);

var len = 2049;
message = Buffer((new Array(len + 1)).join('A'));
var client = unix.createSocket('unix_dgram');

client.on('error', function (err) {
  console.error(err);
  server.close();
  fs.unlink(socketPath);
});

client.send(message, 0, message.length, socketPath);
client.close();

I didn't found any info on these limitation, do you have any information about this?

Can't compile using Node 4.1, Ubuntu 12.04

I can't seem to get this to compile using node 4.1 - is this known?

npm install
/
> [email protected] install /home/company/web-ui/company-lib/node_modules/unix-dgram
> node-gyp rebuild

make: Entering directory `/home/company/web-ui/company-lib/node_modules/unix-dgram/build'
  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
In file included from /home/company/.node-gyp/4.1.1/include/node/node.h:42:0,
                 from ../node_modules/nan/nan.h:24,
                 from ../src/unix_dgram.cc:5:
/home/company/.node-gyp/4.1.1/include/node/v8.h:336:1: error: expected unqualified-id before ‘using’
/home/company/.node-gyp/4.1.1/include/node/v8.h:469:1: error: expected unqualified-id before ‘using’
/home/company/.node-gyp/4.1.1/include/node/v8.h:852:1: error: expected unqualified-id before ‘using’
In file included from ../node_modules/nan/nan.h:182:0,
                 from ../src/unix_dgram.cc:5:
../node_modules/nan/nan_maybe_43_inl.h:13:1: error: expected unqualified-id before ‘using’
../node_modules/nan/nan_maybe_43_inl.h:16:1: error: expected unqualified-id before ‘using’
../node_modules/nan/nan_maybe_43_inl.h:19:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:24:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:31:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:36:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:41:1: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:46:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:51:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:60:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:65:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:70:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:77:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:84:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:92:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:99:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:109:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:115:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:119:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:126:1: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:131:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:136:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:140:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:146:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:151:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:157:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:163:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:169:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:175:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:181:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:187:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:195:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:202:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:206:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:210:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:214:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:218:12: error: ‘MaybeLocal’ does not name a type
In file included from ../node_modules/nan/nan.h:187:0,
                 from ../src/unix_dgram.cc:5:
../node_modules/nan/nan_converters.h:14:11: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_converters.h:16:56: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_converters.h:26:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:27:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:28:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:29:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:30:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:31:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:32:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:42:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:43:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:44:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:45:1: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:46:1: error: ‘return_t’ does not name a type
In file included from ../node_modules/nan/nan_converters.h:59:0,
                 from ../node_modules/nan/nan.h:187,
                 from ../src/unix_dgram.cc:5:
../node_modules/nan/nan_converters_43_inl.h:18:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Boolean>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:19:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Number>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:20:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::String>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:21:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Object>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:22:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Integer>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:23:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Uint32>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:24:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Int32>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:34:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<bool>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:35:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<double>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:36:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<long int>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:37:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<unsigned int>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:38:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<int>’ does not name a type
In file included from ../node_modules/nan/nan.h:188:0,
                 from ../src/unix_dgram.cc:5:
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Integer]’:
../node_modules/nan/nan_new.h:21:32: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’
../node_modules/nan/nan_new.h:21:32: note: candidate is:
../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>)
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Int32]’:
../node_modules/nan/nan_new.h:28:30: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’
../node_modules/nan/nan_new.h:28:30: note: candidate is:
../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>)
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Uint32]’:
../node_modules/nan/nan_new.h:35:31: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’
../node_modules/nan/nan_new.h:35:31: note: candidate is:
../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>)
../node_modules/nan/nan_new.h: At global scope:
../node_modules/nan/nan_new.h:43:11: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_new.h:75:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:141:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:147:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:148:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:160:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:161:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:162:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:163:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:165:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:166:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:182:17: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:183:17: error: ‘return_t’ does not name a type
In file included from ../node_modules/nan/nan_new.h:189:0,
                 from ../node_modules/nan/nan.h:188,
                 from ../src/unix_dgram.cc:5:
../node_modules/nan/nan_implementation_12_inl.h:56:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::Date>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::Function>::return_t Nan::imp::Factory<v8::Function>::New(Nan::FunctionCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan_implementation_12_inl.h:90:46: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::FunctionTemplate>::return_t Nan::imp::Factory<v8::FunctionTemplate>::New(Nan::FunctionCallback, v8::Local<v8::Value>, v8::Local<v8::Signature>)’:
../node_modules/nan/nan_implementation_12_inl.h:118:48: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan_implementation_12_inl.h: At global scope:
../node_modules/nan/nan_implementation_12_inl.h:197:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::RegExp>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:216:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::Script>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:222:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::Script>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:254:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:262:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:268:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:275:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:281:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:286:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:347:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::UnboundScript>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:354:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::UnboundScript>’ does not name a type
In file included from ../node_modules/nan/nan.h:188:0,
                 from ../src/unix_dgram.cc:5:
../node_modules/nan/nan_new.h:291:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:297:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:303:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:309:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:315:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:321:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:327:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::RegExp>’ does not name a type
In file included from ../src/unix_dgram.cc:5:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::Error(const char*)’:
../node_modules/nan/nan.h:639:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowError(const char*)’:
../node_modules/nan/nan.h:639:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::RangeError(const char*)’:
../node_modules/nan/nan.h:640:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowRangeError(const char*)’:
../node_modules/nan/nan.h:640:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::ReferenceError(const char*)’:
../node_modules/nan/nan.h:641:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowReferenceError(const char*)’:
../node_modules/nan/nan.h:641:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::SyntaxError(const char*)’:
../node_modules/nan/nan.h:642:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowSyntaxError(const char*)’:
../node_modules/nan/nan.h:642:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::TypeError(const char*)’:
../node_modules/nan/nan.h:643:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowTypeError(const char*)’:
../node_modules/nan/nan.h:643:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:651:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:673:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:689:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:702:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:719:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:725:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:733:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:740:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h:746:14: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan.h: In member function ‘void Nan::Callback::SetFunction(const v8::Local<v8::Function>&)’:
../node_modules/nan/nan.h:1366:40: error: ‘Set’ was not declared in this scope
../node_modules/nan/nan.h:1366:40: note: suggested alternative:
/home/company/.node-gyp/4.1.1/include/node/v8.h:3021:17: note:   ‘v8::Set’
../node_modules/nan/nan.h: In member function ‘void Nan::AsyncWorker::SaveToPersistent(const char*, const v8::Local<v8::Value>&)’:
../node_modules/nan/nan.h:1488:41: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::AsyncWorker::GetFromPersistent(const char*) const’:
../node_modules/nan/nan.h:1506:45: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In member function ‘virtual void Nan::AsyncWorker::HandleErrorCallback()’:
../node_modules/nan/nan.h:1540:58: error: no matching function for call to ‘New(const char*)’
../node_modules/nan/nan.h:1540:58: note: candidates are:
../node_modules/nan/nan_implementation_12_inl.h:390:21: note: template<class T, class M> v8::Local<T> Nan::New(const v8::Persistent<S, M>&)
../node_modules/nan/nan_implementation_12_inl.h:395:21: note: template<class T, class M> v8::Local<T> Nan::New(const Nan::Persistent<T, M>&)
../node_modules/nan/nan_new.h:201:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New()
../node_modules/nan/nan_new.h:207:1: note: template<class T, class A0> typename Nan::imp::Factory<T>::return_t Nan::New(A0)
../node_modules/nan/nan_new.h:213:1: note: template<class T, class A0, class A1> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1)
../node_modules/nan/nan_new.h:219:1: note: template<class T, class A0, class A1, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2)
../node_modules/nan/nan_new.h:225:1: note: template<class T, class A0, class A1, class A2, class A3> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2, A3)
../node_modules/nan/nan_new.h:237:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>)
../node_modules/nan/nan_new.h:245:1: note: template<class T, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>, A2)
../node_modules/nan/nan.h: In function ‘void Nan::SetMethod(const T&, const char*, Nan::FunctionCallback)’:
../node_modules/nan/nan.h:1829:16: error: there are no arguments to ‘GetFunction’ that depend on a template parameter, so a declaration of ‘GetFunction’ must be available [-fpermissive]
../node_modules/nan/nan.h:1829:16: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
../node_modules/nan/nan.h:1830:45: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::SetPrototypeMethod(v8::Local<v8::FunctionTemplate>, const char*, Nan::FunctionCallback)’:
../node_modules/nan/nan.h:1842:32: error: ‘GetFunction’ was not declared in this scope
../node_modules/nan/nan.h:1843:45: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../node_modules/nan/nan.h:1868:47: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../node_modules/nan/nan.h:1911:51: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘void Nan::SetNamedPropertyHandler(v8::Local<v8::ObjectTemplate>, Nan::PropertyGetterCallback, Nan::PropertySetterCallback, Nan::PropertyQueryCallback, Nan::PropertyDeleterCallback, Nan::PropertyEnumeratorCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:1959:47: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘void Nan::SetIndexedPropertyHandler(v8::Local<v8::ObjectTemplate>, Nan::IndexGetterCallback, Nan::IndexSetterCallback, Nan::IndexQueryCallback, Nan::IndexDeleterCallback, Nan::IndexEnumeratorCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2029:47: error: ‘NewInstance’ was not declared in this scope
In file included from ../src/unix_dgram.cc:5:0:
../node_modules/nan/nan.h: In function ‘void Nan::Export(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE, const char*, Nan::FunctionCallback)’:
../node_modules/nan/nan.h:2090:35: error: no matching function for call to ‘New(const char*&)’
../node_modules/nan/nan.h:2090:35: note: candidates are:
../node_modules/nan/nan_implementation_12_inl.h:390:21: note: template<class T, class M> v8::Local<T> Nan::New(const v8::Persistent<S, M>&)
../node_modules/nan/nan_implementation_12_inl.h:395:21: note: template<class T, class M> v8::Local<T> Nan::New(const Nan::Persistent<T, M>&)
../node_modules/nan/nan_new.h:201:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New()
../node_modules/nan/nan_new.h:207:1: note: template<class T, class A0> typename Nan::imp::Factory<T>::return_t Nan::New(A0)
../node_modules/nan/nan_new.h:213:1: note: template<class T, class A0, class A1> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1)
../node_modules/nan/nan_new.h:219:1: note: template<class T, class A0, class A1, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2)
../node_modules/nan/nan_new.h:225:1: note: template<class T, class A0, class A1, class A2, class A3> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2, A3)
../node_modules/nan/nan_new.h:237:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>)
../node_modules/nan/nan_new.h:245:1: note: template<class T, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>, A2)
../node_modules/nan/nan.h:2091:47: error: ‘GetFunction’ was not declared in this scope
../node_modules/nan/nan.h:2091:65: error: ‘Set’ was not declared in this scope
../node_modules/nan/nan.h:2091:65: note: suggested alternative:
/home/company/.node-gyp/4.1.1/include/node/v8.h:3021:17: note:   ‘v8::Set’
../node_modules/nan/nan.h: In constructor ‘Nan::Tap::Tap(v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2098:30: error: no matching function for call to ‘To(v8::Local<v8::Value>&)’
../node_modules/nan/nan.h:2098:30: note: candidate is:
../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>)
../node_modules/nan/nan.h: In member function ‘void Nan::Tap::ok(bool, const char*)’:
../node_modules/nan/nan.h:2111:33: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In member function ‘void Nan::Tap::pass(const char*)’:
../node_modules/nan/nan.h:2117:30: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../src/unix_dgram.cc: In function ‘void {anonymous}::OnRecv({anonymous}::SocketContext*)’:
../src/unix_dgram.cc:110:15: error: ‘CopyBuffer’ is not a member of ‘Nan’
../src/unix_dgram.cc:112:53: error: no matching function for call to ‘New(char [108])’
../src/unix_dgram.cc:112:53: note: candidates are:
../node_modules/nan/nan_implementation_12_inl.h:390:21: note: template<class T, class M> v8::Local<T> Nan::New(const v8::Persistent<S, M>&)
../node_modules/nan/nan_implementation_12_inl.h:395:21: note: template<class T, class M> v8::Local<T> Nan::New(const Nan::Persistent<T, M>&)
../node_modules/nan/nan_new.h:201:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New()
../node_modules/nan/nan_new.h:207:1: note: template<class T, class A0> typename Nan::imp::Factory<T>::return_t Nan::New(A0)
../node_modules/nan/nan_new.h:213:1: note: template<class T, class A0, class A1> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1)
../node_modules/nan/nan_new.h:219:1: note: template<class T, class A0, class A1, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2)
../node_modules/nan/nan_new.h:225:1: note: template<class T, class A0, class A1, class A2, class A3> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2, A3)
../node_modules/nan/nan_new.h:237:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>)
../node_modules/nan/nan_new.h:245:1: note: template<class T, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>, A2)
../src/unix_dgram.cc: In function ‘void {anonymous}::Initialize(v8::Local<v8::Object>)’:
../src/unix_dgram.cc:395:35: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../src/unix_dgram.cc:396:38: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../src/unix_dgram.cc:398:34: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../src/unix_dgram.cc:401:32: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../src/unix_dgram.cc:404:34: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../src/unix_dgram.cc:407:32: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../src/unix_dgram.cc:410:35: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
../src/unix_dgram.cc:413:33: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’
make: *** [Release/obj.target/unix_dgram/src/unix_dgram.o] Error 1
make: Leaving directory `/home/company/web-ui/company-lib/node_modules/unix-dgram/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/company/node-v4.1.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.5.0-34-generic
gyp ERR! command "/home/company/node-v4.1.1-linux-x64/bin/node" "/home/company/node-v4.1.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/company/web-ui/company-lib/node_modules/unix-dgram
gyp ERR! node -v v4.1.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm ERR! Linux 3.5.0-34-generic
npm ERR! argv "/home/company/node-v4.1.1-linux-x64/bin/node" "/usr/bin/npm" "install"
npm ERR! node v4.1.1
npm ERR! npm  v2.14.4
npm ERR! code ELIFECYCLE

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

npm ERR! Please include the following file with any support request:
npm ERR!     /home/company/web-ui/company-lib/npm-debug.log

Improve mismatched type handling.

When something other than an instance of Buffer is sent to the send* methods an assertion fails causing node to coredump. It seems more reasonable to throw TypeError instead.

> const dgram = require('unix-dgram')
undefined
> const socket = dgram.createSocket('unix_dgram')
undefined
> socket.connect('/run/wpa_supplicant/wlan0')
undefined
> socket.send('ATTACH')
/usr/lib/electron/1.2.8/electron -i: ../src/unix_dgram.cc:304: Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Send(Nan::NAN_METHOD_ARGS_TYPE): Assertion `node::Buffer::HasInstance(buf)' failed.
Aborted (core dumped)\

I can create a pull request for this as well if you guys want.

Error | Failing build unix-dgram on solaris

When I try build unix-dragm on solaris, it failing.
Run cmd: node-gyp configure and node-gyp build.
Output:

-> % node-gyp configure                                                               
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | sunos | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/usr/node/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   '/tmp/node-unix-dgram/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/node/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/export/home/akuzmenko/.node-gyp/6.9.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/export/home/akuzmenko/.node-gyp/6.9.1',
gyp info spawn args   '-Dnode_gyp_dir=/usr/node/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=/tmp/node-unix-dgram',
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 info ok 
-> % node-gyp build                
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | sunos | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/tmp/node-unix-dgram/build'
  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
../src/unix_dgram.cc: In function 'void {anonymous}::OnRecv({anonymous}::SocketContext*)':
../src/unix_dgram.cc:86:24: error: expected unqualified-id before numeric constant
     struct sockaddr_un sun;
                        ^
../src/unix_dgram.cc:95:10: error: expected unqualified-id before numeric constant
   u_addr.sun.sun_path[0] = '\0';
          ^
../src/unix_dgram.cc:95:10: error: expected ';' before numeric constant
../src/unix_dgram.cc:111:16: error: expected unqualified-id before numeric constant
     if (u_addr.sun.sun_path[0] != '\0') {
                ^
../src/unix_dgram.cc:111:16: error: expected ')' before numeric constant
../src/unix_dgram.cc:112:41: error: expected unqualified-id before numeric constant
       argv[2] = Nan::New<String>(u_addr.sun.sun_path).ToLocalChecked();
                                         ^
make: *** [Release/obj.target/unix_dgram/src/unix_dgram.o] Error 1
make: Leaving directory `/tmp/node-unix-dgram/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/node/lib/node_modules/node-gyp/lib/build.js:285:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System SunOS 5.11
gyp ERR! command "/usr/node/bin/node" "/usr/node/bin/node-gyp" "build"
gyp ERR! cwd /tmp/node-unix-dgram
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok 

Packages:

-> % make -v
GNU Make 3.82
Built for i386-pc-solaris2.11
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
-> % gcc -v 
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/lto-wrapper
Target: i386-pc-solaris2.11
Configured with: /builds/hudson/workspace/nightly-update/build/i386/components/gcc48/gcc-4.8.2/configure CC=/usr/gcc/4.7/bin/gcc CXX=/usr/gcc/4.7/bin/g++ --prefix=/usr/gcc/4.8 --mandir=/usr/gcc/4.8/share/man --bindir=/usr/gcc/4.8/bin --libdir=/usr/gcc/4.8/lib --sbindir=/usr/gcc/4.8/sbin --infodir=/usr/gcc/4.8/share/info --libexecdir=/usr/gcc/4.8/lib --enable-languages=c,c++,fortran,objc --enable-shared --with-gmp-include=/usr/include/gmp --with-mpfr-include=/usr/include/mpfr --without-gnu-ld --with-ld=/usr/bin/ld --with-gnu-as --with-as=/usr/gnu/bin/as CFLAGS='-g -O2  -mtune=opteron -march=opteron' CXXFLAGS='-g -O2 -mtune=opteron -march=opteron'
Thread model: posix
gcc version 4.8.2 (GCC) 

Update to more recent version of NAN

I need this to be able to run node 0.11.x. If I just stick 0.8.0 in package.json, I get:

../src/unix_dgram.cc: In function ‘void {anonymous}::StopWatcher(int)’:
../src/unix_dgram.cc:148:21: warning: ‘void NanDispose(v8::Persistent<T>&) [with T = v8::Function]’ is deprecated (declared at ../node_modules/nan/nan.h:397) [-Wdeprecated-declarations]

nan update

Hi, can someone please update the nan version to at least 1.8.2, so it can be used with electron?

  • Trixt0r

Failing to build/install with Cannot open include file: 'unistd.h' on Windows

I'm using a project (winston-syslog) with unix-dgram as a sub-dependecy. Recently it has started failing to build with the following error. All the build tools needed should be in place, as this error started happening more or less out of nowhere..

> [email protected] install C:\project\backend\node_modules\winston-syslog\node_modules\unix-dgram
> node-gyp rebuild


C:\project\backend\node_modules\winston-syslog\node_modules\unix-dgram>if not defined npm_config_node_gyp (node "C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\AppD
ata\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  unix_dgram.cc
  win_delay_load_hook.cc
c:\project\backend\node_modules\winston-syslog\node_modules\unix-dgram\src\unix_dgram.cc(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [C:\project\backend\node_modules\winston-syslog\node_modules\unix-dgram\build\unix_dgram.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:223:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\git\boa\corniche-boa\backend\node_modules\winston-syslog\node_modules\unix-dgram
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

This is on a Windows 10 system. Installing unix-dgram directly (npm install unix-dgram) does not work either.

Is it possible to add Windows support?

I noticed the package has the dummy logic for Windows as there wasn't support for Datagrams over UDS. But I was wondering if given the recent support for AF_UNIX and SOCK_DGRAM on Windows, is it possible to add support?

I'm working on a Windows project and on one side I was able to send data to a Windows Named Pipe with a Stream Socket. But now I need to be able to send Datagrams.

Doesn't build on Node 20.9.0

Building on node 20.9.0 fails with:

npm ERR! path /home/ci/project/registry/node_modules/unix-dgram
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/home/ci/project/registry/node_modules/unix-dgram/build'
npm ERR!   CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
npm ERR! make: Leaving directory '/home/ci/project/registry/node_modules/unix-dgram/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v20.9.0/node-v20.9.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.9.0/node-v20.9.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v20.9.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.9.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/ci/project/deps/node/v20.9.0-v10.2.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/ci/project/registry/node_modules/unix-dgram/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/ci/project/deps/node/v20.9.0-v10.2.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/ci/.cache/node-gyp/20.9.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/ci/.cache/node-gyp/20.9.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/ci/project/deps/node/v20.9.0-v10.2.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/ci/.cache/node-gyp/20.9.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/ci/project/registry/node_modules/unix-dgram',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../../nan/nan.h:178,
npm ERR!                  from ../src/unix_dgram.cc:5:
npm ERR! ../../nan/nan_callbacks.h:55:23: error: 'AccessorSignature' is not a member of 'v8'
npm ERR!    55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR!       |                       ^~~~~~~~~~~~~~~~~
npm ERR! ../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
npm ERR!    55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR!       |                                        ^
npm ERR! In file included from ../src/unix_dgram.cc:5:
npm ERR! ../../nan/nan.h: In function 'bool Nan::IdleNotification(int)':
npm ERR! ../../nan/nan.h:685:32: warning: 'bool v8::Isolate::IdleNotificationDeadline(double)' is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
npm ERR!   685 |         idle_time_in_ms * 0.001);
npm ERR!       |                                ^
npm ERR! In file included from /home/ci/.cache/node-gyp/20.9.0/include/node/v8-initialization.h:13,
npm ERR!                  from /home/ci/.cache/node-gyp/20.9.0/include/node/v8.h:34,
npm ERR!                  from /home/ci/.cache/node-gyp/20.9.0/include/node/node.h:73,
npm ERR!                  from ../../nan/nan.h:58,
npm ERR!                  from ../src/unix_dgram.cc:5:
npm ERR! /home/ci/.cache/node-gyp/20.9.0/include/node/v8-isolate.h:1293:8: note: declared here
npm ERR!  1293 |   bool IdleNotificationDeadline(double deadline_in_seconds);
npm ERR!       |        ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from ../src/unix_dgram.cc:5:
npm ERR! ../../nan/nan.h: In function 'void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)':
npm ERR! ../../nan/nan.h:2551:16: error: no matching function for call to 'v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&, Nan::imp::Sig&)'
npm ERR!  2551 |     , signature);
npm ERR!       |                ^
npm ERR! In file included from /home/ci/.cache/node-gyp/20.9.0/include/node/v8-function.h:15,
npm ERR!                  from /home/ci/.cache/node-gyp/20.9.0/include/node/v8.h:33,
npm ERR!                  from /home/ci/.cache/node-gyp/20.9.0/include/node/node.h:73,
npm ERR!                  from ../../nan/nan.h:58,
npm ERR!                  from ../src/unix_dgram.cc:5:
npm ERR! /home/ci/.cache/node-gyp/20.9.0/include/node/v8-template.h:809:8: note: candidate: 'void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)'
npm ERR!   809 |   void SetAccessor(
npm ERR!       |        ^~~~~~~~~~~
npm ERR! /home/ci/.cache/node-gyp/20.9.0/include/node/v8-template.h:814:22: note:   no known conversion for argument 7 from 'Nan::imp::Sig' {aka 'int'} to 'v8::SideEffectType'
npm ERR!   814 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm ERR!       |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/ci/.cache/node-gyp/20.9.0/include/node/v8-template.h:816:8: note: candidate: 'void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)'
npm ERR!   816 |   void SetAccessor(
npm ERR!       |        ^~~~~~~~~~~
npm ERR! /home/ci/.cache/node-gyp/20.9.0/include/node/v8-template.h:821:22: note:   no known conversion for argument 7 from 'Nan::imp::Sig' {aka 'int'} to 'v8::SideEffectType'
npm ERR!   821 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm ERR!       |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from ../../nan/nan.h:58,
npm ERR!                  from ../src/unix_dgram.cc:5:
npm ERR! ../src/unix_dgram.cc: At global scope:
npm ERR! /home/ci/.cache/node-gyp/20.9.0/include/node/node.h:1170:43: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>)' to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
npm ERR!  1170 |       (node::addon_register_func) (regfunc),                          \
npm ERR!       |                                           ^
npm ERR! /home/ci/.cache/node-gyp/20.9.0/include/node/node.h:1204:3: note: in expansion of macro 'NODE_MODULE_X'
npm ERR!  1204 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!       |   ^~~~~~~~~~~~~
npm ERR! ../src/unix_dgram.cc:404:1: note: in expansion of macro 'NODE_MODULE'
npm ERR!   404 | NODE_MODULE(unix_dgram, Initialize)
npm ERR!       | ^~~~~~~~~~~
npm ERR! make: *** [unix_dgram.target.mk:113: Release/obj.target/unix_dgram/src/unix_dgram.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/ci/project/deps/node/v20.9.0-v10.2.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Linux 5.15.0-1039-aws
npm ERR! gyp ERR! command "/home/ci/project/deps/node/v20.9.0-v10.2.1-linux-x64/bin/node" "/home/ci/project/deps/node/v20.9.0-v10.2.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/ci/project/registry/node_modules/unix-dgram
npm ERR! gyp ERR! node -v v20.9.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok

Can't install in node 6

nan needs to be upgraded but there seems to be more.

Getting this error:

$ npm i unix-dgram
(node:20205) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

[email protected] install /Users/sylviom/tmp/node_modules/unix-dgram
node-gyp rebuild

CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
In file included from ../src/unix_dgram.cc:5:
../node_modules/nan/nan.h:590:20: error: no type named 'GCEpilogueCallback' in 'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback
~~~~~~~~~~~~~^
../node_modules/nan/nan.h:596:20: error: no type named 'GCEpilogueCallback' in 'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback) {
~~~~~~~~~~~~~^
../node_modules/nan/nan.h:601:20: error: no type named 'GCPrologueCallback' in 'v8::Isolate'
v8::Isolate::GCPrologueCallback callback
~~~~~~~~~~~~~^
../node_modules/nan/nan.h:607:20: error: no type named 'GCPrologueCallback' in 'v8::Isolate'
v8::Isolate::GCPrologueCallback callback) {
~~~~~~~~~~~~~^
4 errors generated.
make: *** [Release/obj.target/unix_dgram/src/unix_dgram.o] Error 1
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:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Darwin 15.4.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/sylviom/tmp/node_modules/unix-dgram
gyp ERR! node -v v6.0.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
/Users/sylviom/tmp
└── [email protected]

npm WARN enoent ENOENT: no such file or directory, open '/Users/sylviom/tmp/package.json'
npm WARN tmp No description
npm WARN tmp No repository field.
npm WARN tmp No README data
npm WARN tmp No license field.
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "unix-dgram"
npm ERR! node v6.0.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE

test: test/test-connect.js fails

At commit 17197be:

$ iojs test/test-connect.js
connected
client send PING0
client send PING1
client send PING2
client send PING3
client send PING4
client send PING5
client send PING6
client send PING7
client send PING8
client send PING9
client send PING10
congestion
server recv PING0 { '0': <Buffer 50 49 4e 47 30>,
  '1': { size: 5, address: {}, path: null } }
server recv PING1 { '0': <Buffer 50 49 4e 47 31>,
  '1': { size: 5, address: {}, path: null } }
writable
client send PING11
server recv PING2 { '0': <Buffer 50 49 4e 47 32>,
  '1': { size: 5, address: {}, path: null } }
writable
client send PING12
server recv PING3 { '0': <Buffer 50 49 4e 47 33>,
  '1': { size: 5, address: {}, path: null } }
writable
client send PING13
server recv PING4 { '0': <Buffer 50 49 4e 47 34>,
  '1': { size: 5, address: {}, path: null } }
writable
client send PING14
server recv PING5 { '0': <Buffer 50 49 4e 47 35>,
  '1': { size: 5, address: {}, path: null } }
writable
client send PING15
server recv PING6 { '0': <Buffer 50 49 4e 47 36>,
  '1': { size: 5, address: {}, path: null } }
writable
client send PING16
server recv PING7 { '0': <Buffer 50 49 4e 47 37>,
  '1': { size: 5, address: {}, path: null } }
writable
client send PING17
server recv PING8 { '0': <Buffer 50 49 4e 47 38>,
  '1': { size: 5, address: {}, path: null } }
writable
client send PING18
server recv PING9 { '0': <Buffer 50 49 4e 47 39>,
  '1': { size: 5, address: {}, path: null } }
writable
client send PING19
server recv PING10 { '0': <Buffer 50 49 4e 47 31 30>,
  '1': { size: 6, address: {}, path: null } }
writable
client send PING20
server recv PING11 { '0': <Buffer 50 49 4e 47 31 31>,
  '1': { size: 6, address: {}, path: null } }

assert.js:88
  throw new assert.AssertionError({
        ^
AssertionError: 12 == 21
    at process.<anonymous> (/home/bnoordhuis/src/node-unix-dgram/test/test-connect.js:11:10)
    at emitOne (events.js:77:13)
    at process.emit (events.js:166:7)

/cc @santigimeno

Install failed using Node v10

nan versions is outdated, newer versions of nan does not have that issue

npm i [email protected]

> [email protected] install /private/tmp/qqq/node_modules/unix-dgram
> node-gyp rebuild

  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
In file included from ../src/unix_dgram.cc:5:
In file included from ../../nan/nan.h:190:
../../nan/nan_maybe_43_inl.h:88:15: error: no member named 'ForceSet' in 'v8::Object'
  return obj->ForceSet(GetCurrentContext(), key, value, attribs);
         ~~~  ^

nodejs 12 support

Compile errors on nodejs 12

> [email protected] install /home/travis/build/ioBroker/ioBroker.mqtt/tmp/node_modules/unix-dgram
> node-gyp rebuild
make: Entering directory `/home/travis/build/ioBroker/ioBroker.mqtt/tmp/node_modules/unix-dgram/build'
  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
../src/unix_dgram.cc: In function ‘void {anonymous}::OnRecv({anonymous}::SocketContext*)’:
../src/unix_dgram.cc:121:25: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:959) [-Wdeprecated-declarations]
                     argv);
                         ^
../src/unix_dgram.cc: In function ‘void {anonymous}::OnWritable({anonymous}::SocketContext*)’:
../src/unix_dgram.cc:129:28: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../../nan/nan.h:959) [-Wdeprecated-declarations]
                     0, NULL);
                            ^
../src/unix_dgram.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Socket(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/unix_dgram.cc:189:37: error: no matching function for call to ‘v8::Value::Int32Value()’
   domain      = info[0]->Int32Value();
                                     ^
../src/unix_dgram.cc:189:37: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:190:37: error: no matching function for call to ‘v8::Value::Int32Value()’
   type        = info[1]->Int32Value();
                                     ^
../src/unix_dgram.cc:190:37: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:191:37: error: no matching function for call to ‘v8::Value::Int32Value()’
   protocol    = info[2]->Int32Value();
                                     ^
../src/unix_dgram.cc:191:37: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Bind(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/unix_dgram.cc:230:28: error: no matching function for call to ‘v8::Value::Int32Value()’
   fd = info[0]->Int32Value();
                            ^
../src/unix_dgram.cc:230:28: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:231:33: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’
   String::Utf8Value path(info[1]);
                                 ^
../src/unix_dgram.cc:231:33: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2995:5: note: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
     ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided
../src/unix_dgram.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::SendTo(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/unix_dgram.cc:258:28: error: no matching function for call to ‘v8::Value::Int32Value()’
   fd = info[0]->Int32Value();
                            ^
../src/unix_dgram.cc:258:28: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:259:27: error: no matching function for call to ‘v8::Value::ToObject()’
   buf = info[1]->ToObject();
                           ^
../src/unix_dgram.cc:259:27: note: candidates are:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2532:44: note: v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2532:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/travis/.node-gyp/12.1.0/include/node/v8-internal.h:14:0,
                 from /home/travis/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/travis/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2546:35: note: v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^
/home/travis/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2546:35: note:   candidate expects 1 argument, 0 provided
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^
/home/travis/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^
../src/unix_dgram.cc:260:33: error: no matching function for call to ‘v8::Value::Uint32Value()’
   offset = info[2]->Uint32Value();
                                 ^
../src/unix_dgram.cc:260:33: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2567:41: note: v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
                                         ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2567:41: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:261:33: error: no matching function for call to ‘v8::Value::Uint32Value()’
   length = info[3]->Uint32Value();
                                 ^
../src/unix_dgram.cc:261:33: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2567:41: note: v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
                                         ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2567:41: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:262:33: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’
   String::Utf8Value path(info[4]);
                                 ^
../src/unix_dgram.cc:262:33: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2995:5: note: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
     ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided
../src/unix_dgram.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Send(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/unix_dgram.cc:302:28: error: no matching function for call to ‘v8::Value::Int32Value()’
   fd = info[0]->Int32Value();
                            ^
../src/unix_dgram.cc:302:28: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:303:27: error: no matching function for call to ‘v8::Value::ToObject()’
   buf = info[1]->ToObject();
                           ^
../src/unix_dgram.cc:303:27: note: candidates are:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2532:44: note: v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2532:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/travis/.node-gyp/12.1.0/include/node/v8-internal.h:14:0,
                 from /home/travis/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/travis/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2546:35: note: v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^
/home/travis/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2546:35: note:   candidate expects 1 argument, 0 provided
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^
/home/travis/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^
../src/unix_dgram.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Connect(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/unix_dgram.cc:340:28: error: no matching function for call to ‘v8::Value::Int32Value()’
   fd = info[0]->Int32Value();
                            ^
../src/unix_dgram.cc:340:28: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:341:33: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’
   String::Utf8Value path(info[1]);
                                 ^
../src/unix_dgram.cc:341:33: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2995:5: note: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
     ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided
../src/unix_dgram.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::Close(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/unix_dgram.cc:361:28: error: no matching function for call to ‘v8::Value::Int32Value()’
   fd = info[0]->Int32Value();
                            ^
../src/unix_dgram.cc:361:28: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:2569:40: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc: In function ‘void {anonymous}::Initialize(v8::Local<v8::Object>)’:
../src/unix_dgram.cc:395:70: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated (declared at /home/travis/.node-gyp/12.1.0/include/node/v8.h:3358): Use maybe version [-Wdeprecated-declarations]
   target->Set(Nan::New("AF_UNIX").ToLocalChecked(), Nan::New(AF_UNIX));
                                                                      ^
../src/unix_dgram.cc:396:76: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated (declared at /home/travis/.node-gyp/12.1.0/include/node/v8.h:3358): Use maybe version [-Wdeprecated-declarations]
   target->Set(Nan::New("SOCK_DGRAM").ToLocalChecked(), Nan::New(SOCK_DGRAM));
                                                                            ^
../src/unix_dgram.cc:399:63: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
               Nan::New<FunctionTemplate>(Socket)->GetFunction());
                                                               ^
../src/unix_dgram.cc:399:63: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note: v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)
   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
                                              ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:402:61: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
               Nan::New<FunctionTemplate>(Bind)->GetFunction());
                                                             ^
../src/unix_dgram.cc:402:61: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note: v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)
   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
                                              ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:405:63: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
               Nan::New<FunctionTemplate>(SendTo)->GetFunction());
                                                               ^
../src/unix_dgram.cc:405:63: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note: v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)
   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
                                              ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:408:61: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
               Nan::New<FunctionTemplate>(Send)->GetFunction());
                                                             ^
../src/unix_dgram.cc:408:61: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note: v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)
   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
                                              ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:411:64: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
               Nan::New<FunctionTemplate>(Connect)->GetFunction());
                                                                ^
../src/unix_dgram.cc:411:64: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note: v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)
   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
                                              ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note:   candidate expects 1 argument, 0 provided
../src/unix_dgram.cc:414:62: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
               Nan::New<FunctionTemplate>(Close)->GetFunction());
                                                              ^
../src/unix_dgram.cc:414:62: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/unix_dgram.cc:5:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note: v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)
   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
                                              ^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note:   candidate expects 1 argument, 0 provided
make: *** [Release/obj.target/unix_dgram/src/unix_dgram.o] Error 1

problem installing in iojs

gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack     at F (/home/ubuntu/.nvm/versions/io.js/v1.6.4/lib/node_modules/npm/node_modules/which/which.js:40:28)
gyp ERR! stack     at E (/home/ubuntu/.nvm/versions/io.js/v1.6.4/lib/node_modules/npm/node_modules/which/which.js:43:29)
gyp ERR! stack     at /home/ubuntu/.nvm/versions/io.js/v1.6.4/lib/node_modules/npm/node_modules/which/which.js:54:16
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:77:15)
gyp ERR! System Linux 3.13.0-49-generic
gyp ERR! command "/home/ubuntu/.nvm/versions/io.js/v1.6.4/bin/iojs" "/home/ubuntu/.nvm/versions/io.js/v1.6.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/.pm2/node_modules/pm2-syslog/node_modules/ain2/node_modules/unix-dgram
gyp ERR! node -v v1.6.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing [email protected]

nodejs/node#456

recv fails with buf == null

I am using ain2 with unix socket and recently I have got an error:

TypeError: Cannot read property 'length' of null
at Socket.recv (/usr/lib/node_modules/my_project/node_modules/ain2/node_modules/unix-dgram/lib/unix_dgram.js:27:14)

Seems like buf sometimes can be null, I don't know why, if that is an expected behaviour or not, maybe the solution is just to check if buf is null or not.

No License information.

Hi Ben,

would it be possible for you to add a LICENSE statement to your code please?
People can't use it without.

Thanks,
Denis

Getting EWOULDBLOCK | EAGAIN errno

I'm using this module to write to /dev/log on a Linux machine.
From time to time I'm getting this error:

Error: send 11
at errnoException (/home/user/smartion_node/node_modules/winston-syslog/node_modules/unix-dgram/src/unix_dgram.js:25:11)
at Socket.send (/home/user/smartion_node/node_modules/winston-syslog/node_modules/unix-dgram/src/unix_dgram.js:75:24)

I've seen it's not handled by the library, should I handle it in my code and retry sending or should it be handled in the library in the same way a EINTR error is handled? I can send a pull request if that's the case.

Thanks

Fails to build with iojs v2.0.0

Hi,

I'm having some issues building this package with iojs v2.0.0

npm-debug.log: https://gist.github.com/baseonmars/f69b7eb25ce92e865a9f

I've done a little digging and it looks like the main issue is the version of nan (needs to be v 1.8.4 for V8 4.2 compat).

There's also a warning with node:FatalException from the unix-dgram code it's self.

I've attempted a patch, unfortunatly it breaks backwards compatibility, my C++ knowledge is close to 0, but I've included a link to the branch for reference: https://github.com/baseonmars/node-unix-dgram/tree/iojs-v2.0.0

edit: Just noticed nodejs/nan#327 which could be used instead of node:FatalException when merged and released.

0.1.0 version does not install properly

Installing the 0.1.0 release from npm on both OSX and Linux gives me errors.

This is the output from installing on OSX:

# npm install unix-dgram
npm http GET https://registry.npmjs.org/unix-dgram
npm http 304 https://registry.npmjs.org/unix-dgram
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/nan
> [email protected] install /private/tmp/unix-dgram-test/node_modules/unix-dgram
> node-gyp rebuild

  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
../src/unix_dgram.cc:119:13: error: call to 'NanNew' is ambiguous
  argv[0] = NanNew(err);
            ^~~~~~
../node_modules/nan/nan.h:1249:36: note: candidate function
  NAN_INLINE v8::Local<v8::Number> NanNew(double val) {
                                   ^
../node_modules/nan/nan.h:1253:37: note: candidate function
  NAN_INLINE v8::Local<v8::Integer> NanNew(int val) {
                                    ^
../node_modules/nan/nan.h:1257:36: note: candidate function
  NAN_INLINE v8::Local<v8::Uint32> NanNew(unsigned int val) {
                                   ^
../node_modules/nan/nan.h:1261:37: note: candidate function
  NAN_INLINE v8::Local<v8::Boolean> NanNew(bool val) {
                                    ^
1 error generated.
make: *** [Release/obj.target/unix_dgram/src/unix_dgram.o] Error 1
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:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Darwin 13.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /private/tmp/unix-dgram-test/node_modules/unix-dgram
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the unix-dgram 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 unix-dgram
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "unix-dgram"
npm ERR! cwd /private/tmp/unix-dgram-test
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.10
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /private/tmp/unix-dgram-test/npm-debug.log
npm ERR! not ok code 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.