Coder Social home page Coder Social logo

node-socketwatcher's People

Contributors

btrask avatar ide avatar imyller avatar jonahharris avatar mman avatar zerouid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-socketwatcher's Issues

npm install fails on >=iojs-2.2.x

$ node -v
v2.3.0
$ npm install socketwatcher --save

> [email protected] install /Users/thomas/node_modules/socketwatcher
> node-gyp rebuild

  CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
In file included from ../socket_watcher.cpp:4:
../socket_watcher.hpp:7:36: error: expected class name
class SocketWatcher : public node::ObjectWrap {
                                   ^
../socket_watcher.hpp:14:9: error: unknown type name 'uv_poll_t'
        uv_poll_t* poll_;
        ^
../socket_watcher.hpp:18:48: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
        static v8::Handle<v8::Value> New(const v8::Arguments & args);
                                               ^~~~~~~~~~~~~
                                               v8::internal::Arguments
/Users/thomas/.node-gyp/2.3.0/deps/v8/include/v8.h:134:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../socket_watcher.cpp:4:
../socket_watcher.hpp:19:48: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
        static v8::Handle<v8::Value> Set(const v8::Arguments & args);
                                               ^~~~~~~~~~~~~
                                               v8::internal::Arguments
/Users/thomas/.node-gyp/2.3.0/deps/v8/include/v8.h:134:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../socket_watcher.cpp:4:
../socket_watcher.hpp:20:50: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
        static v8::Handle<v8::Value> Start(const v8::Arguments& args);
                                                 ^~~~~~~~~~~~~
                                                 v8::internal::Arguments
/Users/thomas/.node-gyp/2.3.0/deps/v8/include/v8.h:134:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../socket_watcher.cpp:4:
../socket_watcher.hpp:21:49: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
        static v8::Handle<v8::Value> Stop(const v8::Arguments& args);
                                                ^~~~~~~~~~~~~
                                                v8::internal::Arguments
/Users/thomas/.node-gyp/2.3.0/deps/v8/include/v8.h:134:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../socket_watcher.cpp:4:
../socket_watcher.hpp:25:30: error: unknown type name 'uv_poll_t'
        static void Callback(uv_poll_t *w, int status, int events);
                             ^
../socket_watcher.cpp:39:31: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle<Value> Calleback(const Arguments& args) {
                              ^~~~~~~~~
                              v8::internal::Arguments
/Users/thomas/.node-gyp/2.3.0/deps/v8/include/v8.h:134:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../socket_watcher.cpp:40:12: error: no matching function for call to 'Undefined'
    return Undefined();
           ^~~~~~~~~
/Users/thomas/.node-gyp/2.3.0/deps/v8/include/v8.h:327:28: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
  friend Handle<Primitive> Undefined(Isolate* isolate);
                           ^
../socket_watcher.cpp:47:55: error: cannot initialize a parameter of type 'v8::Isolate *' with an lvalue of type 'v8::Handle<v8::Value> (const v8::internal::Arguments &)'
    Local<FunctionTemplate> t = FunctionTemplate::New(New);
                                                      ^~~
/Users/thomas/.node-gyp/2.3.0/deps/v8/include/v8.h:3871:16: note: passing argument to parameter 'isolate' here
      Isolate* isolate,
               ^
../socket_watcher.cpp:49:29: error: no member named 'NewSymbol' in 'v8::String'
    t->SetClassName(String::NewSymbol("SocketWatcher"));
                    ~~~~~~~~^
../socket_watcher.cpp:52:41: error: cannot initialize a parameter of type 'v8::FunctionCallback' (aka 'void (*)(const FunctionCallbackInfo<v8::Value> &)') with an lvalue of type
      'v8::Handle<v8::Value> (const v8::internal::Arguments &)': type mismatch at 1st parameter ('const FunctionCallbackInfo<v8::Value> &' vs 'const v8::internal::Arguments &')
    NODE_SET_PROTOTYPE_METHOD(t, "set", SocketWatcher::Set);
                                        ^~~~~~~~~~~~~~~~~~
/Users/thomas/.node-gyp/2.3.0/src/node.h:254:60: note: passing argument to parameter 'callback' here
                                      v8::FunctionCallback callback) {
                                                           ^
../socket_watcher.cpp:53:43: error: address of overloaded function 'Start' does not match required type 'void (const v8::FunctionCallbackInfo<v8::Value> &)'
    NODE_SET_PROTOTYPE_METHOD(t, "start", SocketWatcher::Start);
                                          ^~~~~~~~~~~~~~~~~~~~
../socket_watcher.hpp:20:38: note: candidate function has type mismatch at 1st parameter (expected 'const v8::FunctionCallbackInfo<v8::Value> &' but has 'const v8::internal::Arguments &')
        static v8::Handle<v8::Value> Start(const v8::Arguments& args);
                                     ^
../socket_watcher.hpp:23:14: note: candidate function has different number of parameters (expected 1 but has 0)
        void Start();
             ^
/Users/thomas/.node-gyp/2.3.0/src/node.h:254:60: note: passing argument to parameter 'callback' here
                                      v8::FunctionCallback callback) {
                                                           ^
../socket_watcher.cpp:54:42: error: address of overloaded function 'Stop' does not match required type 'void (const v8::FunctionCallbackInfo<v8::Value> &)'
    NODE_SET_PROTOTYPE_METHOD(t, "stop", SocketWatcher::Stop);
                                         ^~~~~~~~~~~~~~~~~~~
../socket_watcher.hpp:21:38: note: candidate function has type mismatch at 1st parameter (expected 'const v8::FunctionCallbackInfo<v8::Value> &' but has 'const v8::internal::Arguments &')
        static v8::Handle<v8::Value> Stop(const v8::Arguments& args);
                                     ^
../socket_watcher.hpp:24:14: note: candidate function has different number of parameters (expected 1 but has 0)
        void Stop();
             ^
/Users/thomas/.node-gyp/2.3.0/src/node.h:254:60: note: passing argument to parameter 'callback' here
                                      v8::FunctionCallback callback) {
                                                           ^
../socket_watcher.cpp:56:25: error: no member named 'NewSymbol' in 'v8::String'
    target->Set(String::NewSymbol("SocketWatcher"), t->GetFunction());
                ~~~~~~~~^
../socket_watcher.cpp:58:23: error: use of undeclared identifier 'NODE_PSYMBOL'
    callback_symbol = NODE_PSYMBOL("callback");
                      ^
../socket_watcher.cpp:61:42: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle<Value> SocketWatcher::Start(const Arguments& args) {
                                         ^~~~~~~~~
                                         v8::internal::Arguments
/Users/thomas/.node-gyp/2.3.0/deps/v8/include/v8.h:134:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../socket_watcher.cpp:62:17: error: calling a protected constructor of class 'v8::HandleScope'
    HandleScope scope;
                ^
/Users/thomas/.node-gyp/2.3.0/deps/v8/include/v8.h:869:13: note: declared protected here
  V8_INLINE HandleScope() {}
            ^
../socket_watcher.cpp:63:30: error: use of undeclared identifier 'ObjectWrap'
    SocketWatcher *watcher = ObjectWrap::Unwrap<SocketWatcher>(args.Holder());
                             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/socketwatcher/socket_watcher.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/thomas/.nvm/versions/io.js/v2.3.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269: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 Darwin 14.4.0
gyp ERR! command "/Users/thomas/.nvm/versions/io.js/v2.3.0/bin/iojs" "/Users/thomas/.nvm/versions/io.js/v2.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/thomas/node_modules/socketwatcher
gyp ERR! node -v v2.3.0
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Darwin 14.4.0
npm ERR! argv "/Users/thomas/.nvm/versions/io.js/v2.3.0/bin/iojs" "/Users/thomas/.nvm/versions/io.js/v2.3.0/bin/npm" "install" "socketwatcher" "--save"
npm ERR! node v2.3.0
npm ERR! npm  v2.11.1
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 socketwatcher 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 socketwatcher
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/thomas/npm-debug.log

Cannot install on node 5.10.0 or 6.4.0

Tested these two versions so far, so far neither work. Does anyone know the last supported version or an alternative package that is maintained?

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
In file included from ../socket_watcher.cpp:5:
In file included from ../socket_watcher.hpp:8:
In file included from ../node_modules/nan/nan.h:80:
In file included from ../node_modules/nan/nan_new.h:190:
../node_modules/nan/nan_implementation_12_inl.h:181:66: error: too many
      arguments to function call, expected at most 2, have 4
  return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);
         ~~~~~~~~~~~~~~~~~~                                      ^~~~~~~~~~
/Users/my-user/.node-gyp/6.4.0/include/node/v8.h:4798:3: note: 'New' declared
      here
  static Local<Signature> New(
  ^
In file included from ../socket_watcher.cpp:5:
In file included from ../socket_watcher.hpp:8:
../node_modules/nan/nan.h:171:25: error: redefinition of '_NanEnsureLocal'
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../node_modules/nan/nan.h:166:25: note: previous definition is here
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                        ^
../node_modules/nan/nan.h:317:12: error: no matching function for call to
      '_NanEnsureLocal'
    return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                                          ^~~~~~~~~~~~~~~
../node_modules/nan/nan.h:171:25: note: candidate template ignored:
      substitution failure [with T = v8::Primitive]
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../node_modules/nan/nan.h:322:12: error: no matching function for call to
      '_NanEnsureLocal'
    return NanEscapeScope(NanNew(v8::Null(v8::Isolate::GetCurrent())));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                                          ^~~~~~~~~~~~~~~
../node_modules/nan/nan.h:171:25: note: candidate template ignored:
      substitution failure [with T = v8::Primitive]
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../node_modules/nan/nan.h:327:12: error: no matching function for call to
      '_NanEnsureLocal'
    return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                                          ^~~~~~~~~~~~~~~
../node_modules/nan/nan.h:171:25: note: candidate template ignored:
      substitution failure [with T = v8::Boolean]
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../node_modules/nan/nan.h:332:12: error: no matching function for call to
      '_NanEnsureLocal'
    return NanEscapeScope(NanNew(v8::False(v8::Isolate::GetCurrent())));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                                          ^~~~~~~~~~~~~~~
../node_modules/nan/nan.h:171:25: note: candidate template ignored:
      substitution failure [with T = v8::Boolean]
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../node_modules/nan/nan.h:376:20: error: no type named 'GCEpilogueCallback' in
      'v8::Isolate'
      v8::Isolate::GCEpilogueCallback callback
      ~~~~~~~~~~~~~^
../node_modules/nan/nan.h:382:20: error: no type named 'GCEpilogueCallback' in
      'v8::Isolate'
      v8::Isolate::GCEpilogueCallback callback) {
      ~~~~~~~~~~~~~^
../node_modules/nan/nan.h:387:20: error: no type named 'GCPrologueCallback' in
      'v8::Isolate'
      v8::Isolate::GCPrologueCallback callback
      ~~~~~~~~~~~~~^
../node_modules/nan/nan.h:393:20: error: no type named 'GCPrologueCallback' in
      'v8::Isolate'
      v8::Isolate::GCPrologueCallback callback) {
      ~~~~~~~~~~~~~^
../node_modules/nan/nan.h:564:13: error: no member named 'smalloc' in
      namespace 'node'
    , node::smalloc::FreeCallback callback
      ~~~~~~^
../node_modules/nan/nan.h:575:12: error: no matching function for call to
      'New'
    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
           ^~~~~~~~~~~~~~~~~
/Users/my-user/.node-gyp/6.4.0/include/node/node_buffer.h:46:40: note: candidate
      function not viable: 2nd argument ('const char *') would lose const
      qualifier
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/my-user/.node-gyp/6.4.0/include/node/node_buffer.h:34:40: note: candidate
      function not viable: no known conversion from 'const char *' to
      'v8::Local<v8::String>' for 2nd argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/my-user/.node-gyp/6.4.0/include/node/node_buffer.h:31:40: note: candidate
      function not viable: requires 2 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_...
                                       ^
/Users/my-user/.node-gyp/6.4.0/include/node/node_buffer.h:39:40: note: candidate
      function not viable: requires 5 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../socket_watcher.cpp:5:
In file included from ../socket_watcher.hpp:8:
../node_modules/nan/nan.h:579:12: error: no viable conversion from returned
      value of type 'v8::MaybeLocal<v8::Object>' to function return type
      'v8::Local<v8::Object>'
    return node::Buffer::New(v8::Isolate::GetCurrent(), size);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/my-user/.node-gyp/6.4.0/include/node/v8.h:216:7: note: candidate
      constructor (the implicit copy constructor) not viable: no known
      conversion from 'v8::MaybeLocal<v8::Object>' to 'const
      v8::Local<v8::Object> &' for 1st argument
class Local {
      ^
/Users/my-user/.node-gyp/6.4.0/include/node/v8.h:216:7: note: candidate
      constructor (the implicit move constructor) not viable: no known
      conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>
      &&' for 1st argument
/Users/my-user/.node-gyp/6.4.0/include/node/v8.h:220:13: note: candidate template
      ignored: could not match 'Local' against 'MaybeLocal'
  V8_INLINE Local(Local<S> that)
            ^
In file included from ../socket_watcher.cpp:5:
In file included from ../socket_watcher.hpp:8:
../node_modules/nan/nan.h:586:26: error: no member named 'Use' in namespace
      'node::Buffer'
    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
           ~~~~~~~~~~~~~~^
../node_modules/nan/nan.h:1403:12: error: no matching function for call to
      '_NanEnsureLocal'
    return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                                          ^~~~~~~~~~~~~~~
../node_modules/nan/nan.h:171:25: note: candidate template ignored:
      substitution failure [with T = v8::Function]
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../node_modules/nan/nan.h:1452:12: error: no matching function for call to
      '_NanEnsureLocal'
    return NanEscapeScope(node::MakeCallback(
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                                          ^~~~~~~~~~~~~~~
../node_modules/nan/nan.h:171:25: note: candidate template ignored:
      substitution failure [with T = v8::Value]
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../node_modules/nan/nan.h:1522:12: error: no matching function for call to
      '_NanEnsureLocal'
    return NanEscapeScope(handle->Get(NanNew(key)).As<v8::Object>());
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:303:43: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                                          ^~~~~~~~~~~~~~~
../node_modules/nan/nan.h:171:25: note: candidate template ignored:
      substitution failure [with T = v8::Object]
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
17 errors generated.
make: *** [Release/obj.target/socketwatcher/socket_watcher.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/my-user/.nvm/versions/v6.4.0/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.6.0
gyp ERR! command "/Users/my-user/.nvm/versions/v6.4.0/bin/node" "/Users/my-user/.nvm/versions/v6.4.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/my-user/Documents/dev/my-project/node_modules/socketwatcher
gyp ERR! node -v v6.4.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/ansi-regex/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/ansi-styles/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/asn1/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/assert-plus/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/aws-sign2/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/aws4/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/boom/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/caseless/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/combined-stream/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/commander/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/cryptiles/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/core-util-is/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/delayed-stream/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/dashdash/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/ecc-jsbn/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/ctype/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/escape-string-regexp/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/extend/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/extsprintf/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/forever-agent/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/generate-function/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/generate-object-property/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/get-stdin/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/getpass/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/git-config-path/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/graceful-readlink/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/has-ansi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/hoek/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/infinity-agent/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/inherits/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/ini/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/is-property/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/is-stream/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/is-typedarray/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/isarray/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/isstream/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/jodid25519/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/jsbn/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/json-schema/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/my-user/Documents/dev/my-project/node_modules/json-stringify-safe/package.json'
npm WARN [email protected] requires a peer of eslint-plugin-import@^1.13.0 but none was installed.
npm WARN [email protected] requires a peer of eslint-plugin-jsx-a11y@^2.1.0 but none was installed.
npm WARN [email protected] requires a peer of eslint-plugin-react@^6.0.0 but none was installed.
npm WARN [email protected] requires a peer of eslint-plugin-import@^1.13.0 but none was installed.
npm WARN [email protected] No repository field.
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/my-user/.nvm/versions/v6.4.0/bin/node" "/Users/my-user/.nvm/versions/v6.4.0/bin/npm" "install" "--save" "pcap"
npm ERR! node v6.4.0
npm ERR! npm  v3.10.3
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! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the socketwatcher 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 information on how to open an issue for this project with:
npm ERR!     npm bugs socketwatcher
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls socketwatcher
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/my-user/Documents/dev/my-project/npm-debug.log
npm ERR! code 1

npm install fails under node 0.12.0

Error log:

CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
In file included from ../socket_watcher.cpp:4:0:
../socket_watcher.hpp:7:47: error: expected class-name before ‘{’ token
 class SocketWatcher : public node::ObjectWrap {
                                               ^
../socket_watcher.hpp:14:9: error: ‘uv_poll_t’ does not name a type
         uv_poll_t* poll_;
         ^
../socket_watcher.hpp:18:48: error: ‘Arguments’ in namespace ‘v8’ does not name a type
         static v8::Handle<v8::Value> New(const v8::Arguments & args);
                                                ^
../socket_watcher.hpp:18:64: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
         static v8::Handle<v8::Value> New(const v8::Arguments & args);
                                                                ^
../socket_watcher.hpp:19:48: error: ‘Arguments’ in namespace ‘v8’ does not name a type
         static v8::Handle<v8::Value> Set(const v8::Arguments & args);
                                                ^
../socket_watcher.hpp:19:64: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
         static v8::Handle<v8::Value> Set(const v8::Arguments & args);
                                                                ^
../socket_watcher.hpp:20:50: error: ‘Arguments’ in namespace ‘v8’ does not name a type
         static v8::Handle<v8::Value> Start(const v8::Arguments& args);
                                                  ^
../socket_watcher.hpp:20:65: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
         static v8::Handle<v8::Value> Start(const v8::Arguments& args);
                                                                 ^
../socket_watcher.hpp:21:49: error: ‘Arguments’ in namespace ‘v8’ does not name a type
         static v8::Handle<v8::Value> Stop(const v8::Arguments& args);
                                                 ^
../socket_watcher.hpp:21:64: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
         static v8::Handle<v8::Value> Stop(const v8::Arguments& args);
                                                                ^
../socket_watcher.hpp:25:30: error: ‘uv_poll_t’ has not been declared
         static void Callback(uv_poll_t *w, int status, int events);
                              ^
../socket_watcher.cpp:39:31: error: ‘Arguments’ does not name a type
 Handle<Value> Calleback(const Arguments& args) {
                               ^
../socket_watcher.cpp:39:42: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle<Value> Calleback(const Arguments& args) {
                                          ^
../socket_watcher.cpp: In function ‘v8::Handle<v8::Value> Calleback(const int&)’:
../socket_watcher.cpp:40:22: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
     return Undefined();
                      ^
In file included from /home/user/.node-gyp/0.12.0/src/node.h:61:0,
                 from ../socket_watcher.hpp:4,
                 from ../socket_watcher.cpp:4:
/home/user/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../socket_watcher.cpp: In constructor ‘SocketWatcher::SocketWatcher()’:
../socket_watcher.cpp:43:34: error: class ‘SocketWatcher’ does not have any field named ‘poll_’
 SocketWatcher::SocketWatcher() : poll_(NULL), fd_(0), events_(0) {
                                  ^
../socket_watcher.cpp: In static member function ‘static void SocketWatcher::Initialize(v8::Handle<v8::Object>)’:
../socket_watcher.cpp:47:58: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
     Local<FunctionTemplate> t = FunctionTemplate::New(New);
                                                          ^
../socket_watcher.cpp:47:58: note: candidate is:
In file included from /home/user/.node-gyp/0.12.0/src/node.h:61:0,
                 from ../socket_watcher.hpp:4,
                 from ../socket_watcher.cpp:4:
/home/user/.node-gyp/0.12.0/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
   static Local<FunctionTemplate> New(
                                  ^
/home/user/.node-gyp/0.12.0/deps/v8/include/v8.h:3455:34: note:   no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’
../socket_watcher.cpp:49:21: error: ‘NewSymbol’ is not a member of ‘v8::String’
     t->SetClassName(String::NewSymbol("SocketWatcher"));
                     ^
../socket_watcher.cpp:52:59: error: invalid conversion from ‘v8::Handle<v8::Value> (*)(const int&)’ to ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ [-fpermissive]
     NODE_SET_PROTOTYPE_METHOD(t, "set", SocketWatcher::Set);
                                                           ^
In file included from ../socket_watcher.hpp:4:0,
                 from ../socket_watcher.cpp:4:
/home/user/.node-gyp/0.12.0/src/node.h:244:13: error:   initializing argument 3 of ‘void node::NODE_SET_PROTOTYPE_METHOD(v8::Handle<v8::FunctionTemplate>, const char*, v8::FunctionCallback)’ [-fpermissive]
 inline void NODE_SET_PROTOTYPE_METHOD(v8::Handle<v8::FunctionTemplate> recv,
             ^
../socket_watcher.cpp:53:63: error: no matches converting function ‘Start’ to type ‘v8::FunctionCallback {aka void (*)(const class v8::FunctionCallbackInfo<v8::Value>&)}’
     NODE_SET_PROTOTYPE_METHOD(t, "start", SocketWatcher::Start);
                                                               ^
In file included from ../socket_watcher.cpp:4:0:
../socket_watcher.hpp:23:14: note: candidates are: void SocketWatcher::Start()
         void Start();
              ^
../socket_watcher.hpp:20:38: note:                 static v8::Handle<v8::Value> SocketWatcher::Start(const int&)
         static v8::Handle<v8::Value> Start(const v8::Arguments& args);
                                      ^
../socket_watcher.cpp:54:61: error: no matches converting function ‘Stop’ to type ‘v8::FunctionCallback {aka void (*)(const class v8::FunctionCallbackInfo<v8::Value>&)}’
     NODE_SET_PROTOTYPE_METHOD(t, "stop", SocketWatcher::Stop);
                                                             ^
In file included from ../socket_watcher.cpp:4:0:
../socket_watcher.hpp:24:14: note: candidates are: void SocketWatcher::Stop()
         void Stop();
              ^
../socket_watcher.hpp:21:38: note:                 static v8::Handle<v8::Value> SocketWatcher::Stop(const int&)
         static v8::Handle<v8::Value> Stop(const v8::Arguments& args);
                                      ^
../socket_watcher.cpp:56:17: error: ‘NewSymbol’ is not a member of ‘v8::String’
     target->Set(String::NewSymbol("SocketWatcher"), t->GetFunction());
                 ^
../socket_watcher.cpp:58:46: error: ‘NODE_PSYMBOL’ was not declared in this scope
     callback_symbol = NODE_PSYMBOL("callback");
                                              ^
../socket_watcher.cpp: At global scope:
../socket_watcher.cpp:61:42: error: ‘Arguments’ does not name a type
 Handle<Value> SocketWatcher::Start(const Arguments& args) {
                                          ^
../socket_watcher.cpp:61:53: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle<Value> SocketWatcher::Start(const Arguments& args) {
                                                     ^
In file included from /home/user/.node-gyp/0.12.0/src/node.h:61:0,
                 from ../socket_watcher.hpp:4,
                 from ../socket_watcher.cpp:4:
/home/user/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> SocketWatcher::Start(const int&)’:
/home/user/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../socket_watcher.cpp:62:17: error: within this context
     HandleScope scope;
                 ^
../socket_watcher.cpp:63:30: error: ‘ObjectWrap’ has not been declared
     SocketWatcher *watcher = ObjectWrap::Unwrap<SocketWatcher>(args.Holder());
                              ^
../socket_watcher.cpp:63:62: error: expected primary-expression before ‘>’ token
     SocketWatcher *watcher = ObjectWrap::Unwrap<SocketWatcher>(args.Holder());
                                                              ^
../socket_watcher.cpp:63:69: error: request for member ‘Holder’ in ‘args’, which is of non-class type ‘const int’
     SocketWatcher *watcher = ObjectWrap::Unwrap<SocketWatcher>(args.Holder());
                                                                     ^
../socket_watcher.cpp:65:22: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
     return Undefined();
                      ^
In file included from /home/user/.node-gyp/0.12.0/src/node.h:61:0,
                 from ../socket_watcher.hpp:4,
                 from ../socket_watcher.cpp:4:
/home/user/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: declared here
   friend Handle<Primitive> Undefined(Isolate* isolate);
                            ^
../socket_watcher.cpp: In member function ‘void SocketWatcher::Start()’:
../socket_watcher.cpp:69:9: error: ‘poll_’ was not declared in this scope
     if (poll_ == NULL) {
         ^
../socket_watcher.cpp:70:21: error: expected type-specifier before ‘uv_poll_t’
         poll_ = new uv_poll_t;
                     ^
../socket_watcher.cpp:70:21: error: expected ‘;’ before ‘uv_poll_t’
../socket_watcher.cpp:71:31: error: ‘uv_poll_t’ was not declared in this scope
         memset(poll_,0,sizeof(uv_poll_t));
                               ^
../socket_watcher.cpp:73:45: error: ‘uv_default_loop’ was not declared in this scope
         uv_poll_init_socket(uv_default_loop(), poll_, fd_);
                                             ^
../socket_watcher.cpp:73:58: error: ‘uv_poll_init_socket’ was not declared in this scope
         uv_poll_init_socket(uv_default_loop(), poll_, fd_);
                                                          ^
../socket_watcher.cpp:75:13: error: ‘Ref’ was not declared in this scope
         Ref();
             ^
../socket_watcher.cpp:78:24: error: ‘uv_handle_t’ was not declared in this scope
     if (!uv_is_active((uv_handle_t*)poll_)) {
                        ^
../socket_watcher.cpp:78:36: error: expected primary-expression before ‘)’ token
     if (!uv_is_active((uv_handle_t*)poll_)) {
                                    ^
../socket_watcher.cpp:78:42: error: ‘uv_is_active’ was not declared in this scope
     if (!uv_is_active((uv_handle_t*)poll_)) {
                                          ^
../socket_watcher.cpp:79:23: error: ‘poll_’ was not declared in this scope
         uv_poll_start(poll_, events_, &SocketWatcher::Callback);
                       ^
../socket_watcher.cpp:79:63: error: ‘uv_poll_start’ was not declared in this scope
         uv_poll_start(poll_, events_, &SocketWatcher::Callback);
                                                               ^
../socket_watcher.cpp: At global scope:
../socket_watcher.cpp:83:30: error: variable or field ‘Callback’ declared void
 void SocketWatcher::Callback(uv_poll_t *w, int status, int revents) {
                              ^
../socket_watcher.cpp:83:30: error: ‘uv_poll_t’ was not declared in this scope
../socket_watcher.cpp:83:41: error: ‘w’ was not declared in this scope
 void SocketWatcher::Callback(uv_poll_t *w, int status, int revents) {
                                         ^
../socket_watcher.cpp:83:44: error: expected primary-expression before ‘int’
 void SocketWatcher::Callback(uv_poll_t *w, int status, int revents) {
                                            ^
../socket_watcher.cpp:83:56: error: expected primary-expression before ‘int’
 void SocketWatcher::Callback(uv_poll_t *w, int status, int revents) {
                                                        ^
../socket_watcher.cpp: In function ‘v8::Handle<v8::Value> Calleback(const int&)’:
../socket_watcher.cpp:41:1: warning: control reaches end of non-void function [-Wreturn-type]
 };
 ^
../socket_watcher.cpp: In static member function ‘static v8::Handle<v8::Value> SocketWatcher::Start(const int&)’:
../socket_watcher.cpp:66:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

Get permission from original author

This module is based on @TobyEalden's SocketWatcher for node_mdns. His code did not have any copyright or license statement attached, although node_mdns is MIT licensed, which license I've attached to this project as well.

In an effort to be completely forthright, I'll wait for his permission before we submit this module to npm. If he doesn't see my mention here, I'll send him an email later.

And if you're reading this, Toby, thanks for the great software. My intention with this module is to make it easily reusable for other projects like node_pcap.

Make error

When I try to install I get an error as per below

CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
../socket_watcher.cpp:162:1: error: invalid conversion from ‘void ()(v8::Handlev8::Object, v8::Handlev8::Object)’ to ‘void ()(v8::Handlev8::Object)’ [-fpermissive]
make: *** [Release/obj.target/socketwatcher/socket_watcher.o] Error 1
make: Leaving directory `/home/...../node-red/node_modules/socketwatcher/build'

npm install fails.

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:104:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:862:12)
gyp ERR! System Linux 3.11.0-12-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/devd/Documents/capture/node_modules/socketwatcher
gyp ERR! node -v v0.11.10
gyp ERR! node-gyp -v v0.12.1
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.

Is what im getting when try to install it

Windows7 - Assert 0 thrown by libuv after this function is called.

    if (!uv_is_active((uv_handle_t*)poll_)) {
        uv_poll_start(poll_, events_, &SocketWatcher::Callback);
    }

I am trying to use node_pcap which uses socketwatcher.
After uv_poll_start is called but not directly after I get the following assert.
Assertion failed: 0, file g:\jenkins\workspace\nodejs-msi\d73b0901\deps\uv\src\win\req-inl.h, line 219

I used the MSI of node.js do I have to download latest node and compile it? I will try that next.
In req-inl.h there is a switch case for handling req->type. I guess it does not contain something that socket watcher or node_pcap is causing socket watcher to use?.

I shall try and upgrade on a new computer later today and if that does not work investigate why. Thought I would post here incase anyone else has had issues?.

Cheers,

segfault when re-setting after starting

e.g.

var SocketWatcher = require("socketwatcher").SocketWatcher;
var w = new SocketWatcher();
w.set(0, true, false);
w.start();
// w.stop(); // same whether or not this is commented in/out
w.set(0, true, false);

output:

node: ../socket_watcher.cpp:131: static void SocketWatcher::Set(const Nan::FunctionCallbackInfo<v8::Value>&): Assertion `watcher->poll_ == NULL' failed.
Aborted (core dumped)

Issues compiling with Node v10+

I am having an issue compiling this package with Node v10+, on the other hand the stable Node 8.11.2 is still working fine.

I believe some of these v8 and Nan usages are now deprecated.

> [email protected] install /path/node_modules/socketwatcher
> node-gyp rebuild

make: Entering directory '/path/node_modules/socketwatcher/build'
  CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
../socket_watcher.cpp: In static member function ‘static void SocketWatcher::Callback(uv_poll_t*, int, int)’:
../socket_watcher.cpp:77:60: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated [-Wdeprecated-declarations]
   Nan::MakeCallback(watcher->handle(), callback, argc, argv);
                                                            ^
In file included from ../socket_watcher.hpp:8:0,
                 from ../socket_watcher.cpp:5:
../../nan/nan.h:929:46: note: declared here
   NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
                                              ^
../socket_watcher.cpp: In static member function ‘static void SocketWatcher::New(const Nan::FunctionCallbackInfo<v8::Value>&)’:
../socket_watcher.cpp:104:49: error: no matching function for call to ‘v8::Function::NewInstance()’
     info.GetReturnValue().Set(cons->NewInstance());
                                                 ^
In file included from /home/user/.node-gyp/10.2.1/include/node/node.h:63:0,
                 from ../../nan/nan.h:51,
                 from ../socket_watcher.hpp:8,
                 from ../socket_watcher.cpp:5:
/home/user/.node-gyp/10.2.1/include/node/v8.h:3859:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^
/home/user/.node-gyp/10.2.1/include/node/v8.h:3859:44: note:   candidate expects 3 arguments, 0 provided
/home/user/.node-gyp/10.2.1/include/node/v8.h:3862:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^
/home/user/.node-gyp/10.2.1/include/node/v8.h:3862:44: note:   candidate expects 1 argument, 0 provided
socketwatcher.target.mk:95: recipe for target 'Release/obj.target/socketwatcher/socket_watcher.o' failed
make: *** [Release/obj.target/socketwatcher/socket_watcher.o] Error 1
make: Leaving directory '/path/node_modules/socketwatcher/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/user/n/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.4.0-62-generic
gyp ERR! command "/home/user/n/bin/node" "/home/user/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /path/node_modules/socketwatcher
gyp ERR! node -v v10.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

While install npm on ngraph repository code it throws error

When I was install the npm on ngraph it throws
deprecated error.

`marudhu@marudhu-Vostro-2420:~/Repository/word-duniya/ngraph$ npm install

[email protected] install /home/marudhu/Repository/word-duniya/ngraph/node_modules/contextify
node-gyp rebuild

make: Entering directory '/home/marudhu/Repository/word-duniya/ngraph/node_modules/contextify/build'
CXX(target) Release/obj.target/contextify/src/contextify.o
../src/contextify.cc: In static member function ‘static v8::Localv8::Context ContextWrap::createV8Context(v8::Localv8::Object)’:
../src/contextify.cc:131:68: warning: ‘v8::Localv8::Object v8::Function::NewInstance() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
Local wrapper = Nan::New(constructor)->NewInstance();
^
In file included from /home/marudhu/.node-gyp/7.10.0/include/node/v8.h:26:0,
from /home/marudhu/.node-gyp/7.10.0/include/node/node.h:42,
from ../src/contextify.cc:1:
/home/marudhu/.node-gyp/7.10.0/include/node/v8.h:3662:52: note: declared here
V8_DEPRECATED("Use maybe version", Local NewInstance() const);
^
/home/marudhu/.node-gyp/7.10.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
declarator attribute((deprecated(message)))
^
../src/contextify.cc:150:16: error: ‘class v8::ObjectTemplate’ has no member named ‘SetAccessCheckCallbacks’
otmpl->SetAccessCheckCallbacks(GlobalPropertyNamedAccessCheck,
^
../src/contextify.cc: In static member function ‘static void ContextWrap::GlobalPropertyGetter(v8::Localv8::String, const Nan::PropertyCallbackInfov8::Value&)’:
../src/contextify.cc:182:80: warning: ‘v8::Localv8::Value v8::Object::GetRealNamedProperty(v8::Localv8::String)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
Local rv = Nan::New(ctx->sandbox)->GetRealNamedProperty(property);
^
In file included from /home/marudhu/.node-gyp/7.10.0/include/node/v8.h:26:0,
from /home/marudhu/.node-gyp/7.10.0/include/node/node.h:42,
from ../src/contextify.cc:1:
/home/marudhu/.node-gyp/7.10.0/include/node/v8.h:3234:30: note: declared here
Local GetRealNamedProperty(Local key));
^
/home/marudhu/.node-gyp/7.10.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
declarator attribute((deprecated(message)))
^
../src/contextify.cc: In static member function ‘static void ContextWrap::GlobalPropertyQuery(v8::Localv8::String, const Nan::PropertyCallbackInfov8::Integer&)’:
../src/contextify.cc:209:67: warning: ‘v8::Localv8::Value v8::Object::GetRealNamedProperty(v8::Localv8::String)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
if (!Nan::New(ctx->sandbox)->GetRealNamedProperty(property).IsEmpty() ||
^
In file included from /home/marudhu/.node-gyp/7.10.0/include/node/v8.h:26:0,
from /home/marudhu/.node-gyp/7.10.0/include/node/node.h:42,
from ../src/contextify.cc:1:
/home/marudhu/.node-gyp/7.10.0/include/node/v8.h:3234:30: note: declared here
Local GetRealNamedProperty(Local key));
^
/home/marudhu/.node-gyp/7.10.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
declarator attribute((deprecated(message)))
^
../src/contextify.cc:210:71: warning: ‘v8::Localv8::Value v8::Object::GetRealNamedProperty(v8::Localv8::String)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
!Nan::New(ctx->proxyGlobal)->GetRealNamedProperty(property).IsEmpty()) {
^
In file included from /home/marudhu/.node-gyp/7.10.0/include/node/v8.h:26:0,
from /home/marudhu/.node-gyp/7.10.0/include/node/node.h:42,
from ../src/contextify.cc:1:
/home/marudhu/.node-gyp/7.10.0/include/node/v8.h:3234:30: note: declared here
Local GetRealNamedProperty(Local key));
^
/home/marudhu/.node-gyp/7.10.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
declarator attribute((deprecated(message)))
^
contextify.target.mk:94: recipe for target 'Release/obj.target/contextify/src/contextify.o' failed
make: *** [Release/obj.target/contextify/src/contextify.o] Error 1
make: Leaving directory '/home/marudhu/Repository/word-duniya/ngraph/node_modules/contextify/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:194:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.0-77-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/marudhu/Repository/word-duniya/ngraph/node_modules/contextify
gyp ERR! node -v v7.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN ngraph No repository field.
npm WARN ngraph 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! /home/marudhu/.npm/_logs/2017-09-27T09_10_16_267Z-debug.log
`

compilation Error nodejs v12

Hi,

compiling for nodejs v12 is not possible, could you please update in order to be v8 compliant?

Thanks,
Felix

pi@xxx:/usr/local/lib $ sudo npm install -g --unsafe-perm socketwatcher -g

[email protected] install /usr/local/lib/node_modules/socketwatcher
node-gyp rebuild

make: Verzeichnis „/usr/local/lib/node_modules/socketwatcher/build“ wird betreten
CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
../socket_watcher.cpp: In static member function ‘static void SocketWatcher::Initialize(v8::Localv8::Object)’:
../socket_watcher.cpp:29:36: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
constructor.Reset(t->GetFunction());
^
In file included from /root/.cache/node-gyp/12.8.1/include/node/node.h:63:0,
from ../node_modules/nan/nan.h:54,
from ../socket_watcher.hpp:8,
from ../socket_watcher.cpp:5:
/root/.cache/node-gyp/12.8.1/include/node/v8.h:5955:46: note: candidate: v8::MaybeLocalv8::Function v8::FunctionTemplate::GetFunction(v8::Localv8::Context)
V8_WARN_UNUSED_RESULT MaybeLocal GetFunction(
^~~~~~~~~~~
/root/.cache/node-gyp/12.8.1/include/node/v8.h:5955:46: note: candidate expects 1 argument, 0 provided
../socket_watcher.cpp:30:75: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
exports->Set(Nan::New("SocketWatcher").ToLocalChecked(), t->GetFunction());
^
In file included from /root/.cache/node-gyp/12.8.1/include/node/node.h:63:0,
from ../node_modules/nan/nan.h:54,
from ../socket_watcher.hpp:8,
from ../socket_watcher.cpp:5:
/root/.cache/node-gyp/12.8.1/include/node/v8.h:5955:46: note: candidate: v8::MaybeLocalv8::Function v8::FunctionTemplate::GetFunction(v8::Localv8::Context)
V8_WARN_UNUSED_RESULT MaybeLocal GetFunction(
^~~~~~~~~~~
/root/.cache/node-gyp/12.8.1/include/node/v8.h:5955:46: note: candidate expects 1 argument, 0 provided
../socket_watcher.cpp: In static member function ‘static void SocketWatcher::Callback(uv_poll_t*, int, int)’:
../socket_watcher.cpp:77:60: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations]
Nan::MakeCallback(watcher->handle(), callback, argc, argv);
^
In file included from ../socket_watcher.hpp:8:0,
from ../socket_watcher.cpp:5:
../node_modules/nan/nan.h:1024:46: note: declared here
NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
^~~~~~~~~~~~
../socket_watcher.cpp: In static member function ‘static void SocketWatcher::New(const Nan::FunctionCallbackInfov8::Value&)’:
../socket_watcher.cpp:104:49: error: no matching function for call to ‘v8::Function::NewInstance()’
info.GetReturnValue().Set(cons->NewInstance());
^
In file included from /root/.cache/node-gyp/12.8.1/include/node/node.h:63:0,
from ../node_modules/nan/nan.h:54,
from ../socket_watcher.hpp:8,
from ../socket_watcher.cpp:5:
/root/.cache/node-gyp/12.8.1/include/node/v8.h:4138:44: note: candidate: v8::MaybeLocalv8::Object v8::Function::NewInstance(v8::Localv8::Context, int, v8::Localv8::Value
) const
V8_WARN_UNUSED_RESULT MaybeLocal NewInstance(
^~~~~~~~~~~
/root/.cache/node-gyp/12.8.1/include/node/v8.h:4138:44: note: candidate expects 3 arguments, 0 provided
/root/.cache/node-gyp/12.8.1/include/node/v8.h:4141:44: note: candidate: v8::MaybeLocalv8::Object v8::Function::NewInstance(v8::Localv8::Context) const
V8_WARN_UNUSED_RESULT MaybeLocal NewInstance(
^~~~~~~~~~~
/root/.cache/node-gyp/12.8.1/include/node/v8.h:4141:44: note: candidate expects 1 argument, 0 provided
../socket_watcher.cpp: In static member function ‘static void SocketWatcher::Set(const Nan::FunctionCallbackInfov8::Value&)’:
../socket_watcher.cpp:116:32: error: no matching function for call to ‘v8::Value::Int32Value()’
int fd = info[0]->Int32Value();
^
In file included from /root/.cache/node-gyp/12.8.1/include/node/node.h:63:0,
from ../node_modules/nan/nan.h:54,
from ../socket_watcher.hpp:8,
from ../socket_watcher.cpp:5:
/root/.cache/node-gyp/12.8.1/include/node/v8.h:2576:40: note: candidate: v8::Maybe v8::Value::Int32Value(v8::Localv8::Context) const
V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local context) const;
^~~~~~~~~~
/root/.cache/node-gyp/12.8.1/include/node/v8.h:2576:40: note: candidate expects 1 argument, 0 provided
socketwatcher.target.mk:107: die Regel für Ziel „Release/obj.target/socketwatcher/socket_watcher.o“ scheiterte
make: *** [Release/obj.target/socketwatcher/socket_watcher.o] Fehler 1
make: Verzeichnis „/usr/local/lib/node_modules/socketwatcher/build“ wird verlassen
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:196:23)
gyp ERR! stack at ChildProcess.emit (events.js:203:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.19.66-v7+
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 /usr/local/lib/node_modules/socketwatcher
gyp ERR! node -v v12.8.1
gyp ERR! node-gyp -v v5.0.3
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! /root/.npm/_logs/2019-08-20T15_43_29_027Z-debug.log

Cannot Install on Node 7.5.0 on OSX El Capitan

When trying to execute an install of socketwatcher on OSX, this error happens and the installation cannot be completed. Hence, I cannot use many modules which depend on it, especially pcap-based ones.

PDC-SWE-Lab-Mac-Mini:dash-example anthonyjesmok$ sudo npm install socketwatcher -g

> [email protected] install /usr/local/lib/node_modules/socketwatcher
> node-gyp rebuild

  CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
../socket_watcher.cpp:104:37: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
    info.GetReturnValue().Set(cons->NewInstance());
                                    ^
/Users/anthonyjesmok/.node-gyp/7.5.0/include/node/v8.h:3292:52: note: 'NewInstance' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
                                                   ^
1 warning generated.
  SOLINK_MODULE(target) Release/socketwatcher.node
/usr/local/lib
└── [email protected] 

PDC-SWE-Lab-Mac-Mini:dash-example anthonyjesmok$ 

Deprecation warning

> node-gyp rebuild

make: Entering directory '/home/daurnimator/someproject/node_modules/socketwatcher/build'
  CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
../socket_watcher.cpp: In static member function ‘static void SocketWatcher::New(const Nan::FunctionCallbackInfo<v8::Value>&)’:
../socket_watcher.cpp:104:49: warning: ‘v8::Local<v8::Object> v8::Function::NewInstance() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     info.GetReturnValue().Set(cons->NewInstance());
                                                 ^
In file included from /home/daurnimator/.node-gyp/7.10.0/include/node/v8.h:26:0,
                 from /home/daurnimator/.node-gyp/7.10.0/include/node/node.h:42,
                 from ../../nan/nan.h:49,
                 from ../socket_watcher.hpp:8,
                 from ../socket_watcher.cpp:5:
/home/daurnimator/.node-gyp/7.10.0/include/node/v8.h:3662:52: note: declared here
   V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
                                                    ^
/home/daurnimator/.node-gyp/7.10.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/socketwatcher.node
  COPY Release/socketwatcher.node
make: Leaving directory '/home/daurnimator/someproject/node_modules/socketwatcher/build'

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.