如何为node.js手动安装arpjs模块?

时间:2015-11-15 13:36:33

标签: node.js module

我正在尝试安装arpjs模块...当我尝试使用

安装它时
npm install arpjs 

npm install  
sudo npm install https://github.com/skepticfx/arpjs.git 

我总是收到这个错误:

  

npm WARN生命周期typechecker@2.0.8 ~preinstall:无法在wd%s%s(wd =%s)typechecker@2.0.8节点中运行./cyclic.js /usr/lib/node_modules/.staging/typechecker -8e5299d6dc600530516e3f6be254ad7d

     

socketwatcher@0.2.1 install / usr / lib / node_modules / arpjs / node_modules / socketwatcher
  node-gyp rebuild

     

make:输入目录/usr/lib/node_modules/arpjs/node_modules/socketwatcher/build'
CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
In file included from ../node_modules/nan/nan_new.h:190:0,
from ../node_modules/nan/nan.h:80, from ../socket_watcher.hpp:8, from ../socket_watcher.cpp:5:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static NanIntern::FactoryBase<v8::Signature>::return_t
NanIntern::Factory<v8::Signature>::New(NanIntern::Factory<v8::Signature>::FTH, int, NanIntern::Factory<v8::Signature>::FTH*)’:
../node_modules/nan/nan_implementation_12_inl.h:181:76: error: no matching function for call to ‘v8::Signature::New(v8::Isolate*, NanIntern::Factory<v8::Signature>::FTH&, int&, NanIntern::Factory<v8::Signature>::FTH*&)’ return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv); ^ ../node_modules/nan/nan_implementation_12_inl.h:181:76: note: candidate is: In file included from /home/groshev/.node-gyp/5.0.0/include/node/node.h:42:0, from ../node_modules/nan/nan.h:24, from ../socket_watcher.hpp:8, from ../socket_watcher.cpp:5: /home/groshev/.node-gyp/5.0.0/include/node/v8.h:4674:27: note: static v8::Local<v8::Signature> v8::Signature::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>) static Local<Signature> New( ^ /home/groshev/.node-gyp/5.0.0/include/node/v8.h:4674:27: note: candidate expects 2 arguments, 4 provided In file included from ../socket_watcher.hpp:8:0, from ../socket_watcher.cpp:5: ../node_modules/nan/nan.h: At global scope: ../node_modules/nan/nan.h:171:25: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’ NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) { ^ ../node_modules/nan/nan.h:166:25: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) { ^ ../node_modules/nan/nan.h:564:13: error: ‘node::smalloc’ has not been declared , node::smalloc::FreeCallback callback ^ ../node_modules/nan/nan.h:564:35: error: expected ‘,’ or ‘...’ before ‘callback’ , node::smalloc::FreeCallback callback ^ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’: ../node_modules/nan/nan.h:568:50: error: ‘callback’ was not declared in this scope v8::Isolate::GetCurrent(), data, length, callback, hint); ^ ../node_modules/nan/nan.h:568:60: error: ‘hint’ was not declared in this scope v8::Isolate::GetCurrent(), data, length, callback, hint); ^ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’: ../node_modules/nan/nan.h:575:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous return node::Buffer::New(v8::Isolate::GetCurrent(), data, size); ^ ../node_modules/nan/nan.h:575:67: note: candidates are: In file included from ../node_modules/nan/nan.h:25:0, from ../socket_watcher.hpp:8, from ../socket_watcher.cpp:5: /home/groshev/.node-gyp/5.0.0/include/node/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match> NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, ^ /home/groshev/.node-gyp/5.0.0/include/node/node_buffer.h:31:40: note: no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’ /home/groshev/.node-gyp/5.0.0/include/node/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match> NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, ^ /home/groshev/.node-gyp/5.0.0/include/node/node_buffer.h:43:40: note: no known conversion for argument 2 from ‘const char*’ to ‘char*’ In file included from ../socket_watcher.hpp:8:0, from ../socket_watcher.cpp:5: ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’: ../node_modules/nan/nan.h:579:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), size)’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’ return node::Buffer::New(v8::Isolate::GetCurrent(), size); ^ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’: ../node_modules/nan/nan.h:586:12: error: ‘Use’ is not a member of ‘node::Buffer’ return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size); ^ make: *** [Release/obj.target/socketwatcher/socket_watcher.o] Error 1 make: Leaving directory
/ usr / lib / node_modules / arpjs / node_modules / socketwatcher / build&#39;       gyp ERR!构建错误       gyp ERR!堆栈错误:make失败并退出代码:2       gyp ERR!在ChildProcess.onExit堆栈(/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)       gyp ERR!堆栈在emitTwo(events.js:87:13)       gyp ERR!在ChildProcess.emit堆栈(events.js:172:7)       gyp ERR! Process.ChildProcess._handle.onexit(internal / child_process.js:200:12)中的堆栈       gyp ERR!系统Linux 3.16.0-52-通用       gyp ERR!命令&#34; / usr / bin / nodejs&#34; &#34; /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" &#34;重建&#34;       gyp ERR! cwd / usr / lib / node_modules / arpjs / node_modules / socketwatcher       gyp ERR! node -v v5.0.0       gyp ERR! node-gyp -v v3.0.3       gyp ERR!不好       npm WARN安装:socketwatcher@0.2.1 socketwatcher@0.2.1安装:node-gyp rebuild       npm WARN安装:socketwatcher@0.2.1退出状态1       / usr / lib目录       └──(空)

npm ERR! code 1

所以我想手动下载sorurce表单github并安装它。但是这个模块依赖于其他模块(ip,mac和pcap)。 那我怎么能这样做呢?

1 个答案:

答案 0 :(得分:0)

此问题已在最新版本的arpjs(1.1.0)中修复。尝试使用npm install arpjs

再次安装arpjs