LoginSignup
0
1

More than 5 years have passed since last update.

npm install pcap が エラーになるとき

Posted at

久しぶりにdash buttonを押してみたら、反応しないので、確認してみると、
どうも、pcapがうまく動いていないようだ、、、ということで対処してみた。

( Raspberry Pi3 on Ubuntu Mate 16.04 で Amazon Dash を ただのIoTボタンとして使う などで使い方は紹介しています )

$ npm install pcap
..snip..
../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);
..snip..
make: *** [Release/obj.target/socketwatcher/socket_watcher.o] Error 1
make: Leaving directory '/home/hidenorly/node_modules/socketwatcher/build'
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:258: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 Linux 4.4.38-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 /home/hidenorly/node_modules/socketwatcher
gyp ERR! node -v v7.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

$ sudo apt-get install libpcap-dev

はもちろんやっておいた上で、

$ sudo chown -R $USER:$(id -gn $USER) /home/hidenorly/.config

をした上で、

$ npm install https://github.com/mranney/node_pcap.git

すると、

> pcap@2.0.0 install /home/hidenorly/node_modules/pcap
> node-gyp rebuild
..snip..
make: Leaving directory '/home/hidenorly/node_modules/pcap/build'
npm WARN saveError ENOENT: no such file or directory, open '/home/hidenorly/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/hidenorly/package.json'
npm WARN hidenorly No description
npm WARN hidenorly No repository field.
npm WARN hidenorly No README data
npm WARN hidenorly No license field.

+ pcap@2.0.0
updated 1 package in 14.912s

みたいにして成功するようになります。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1