Dasher on Pi 3 won't install, issues with npm I think, anyone run into this and know a fix?

I get the following when I try to install, I’ve seen different tips to try to work around errors but can’t figure out what this one is…

pi@raspberrypi:~/dasher $ sudo npm install
\
> [email protected] install /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.4.4"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/.node-gyp"
make: Entering directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'
  CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
  SOLINK_MODULE(target) Release/obj.target/socketwatcher.node
  COPY Release/socketwatcher.node
make: Leaving directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'

> [email protected] install /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.4.4"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/.node-gyp"
make: Entering directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/build'
  CXX(target) Release/obj.target/pcap_binding/pcap_binding.o
../pcap_binding.cc:2:23: fatal error: pcap/pcap.h: No such file or directory
 #include <pcap/pcap.h>
                       ^
compilation terminated.
pcap_binding.target.mk:89: recipe for target 'Release/obj.target/pcap_binding/pcap_binding.o' failed
make: *** [Release/obj.target/pcap_binding/pcap_binding.o] Error 1
make: Leaving directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/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:276: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 4.4.50-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/pi/dasher/node_modules/node-dash-button/node_modules/pcap
gyp ERR! node -v v4.4.4
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Linux 4.4.50-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.4.4
npm ERR! npm  v2.15.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 pcap 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 pcap
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls pcap
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/pi/dasher/npm-debug.log

quick update I found somewhere on GitHub that said to run “sudo npm install -g np” in order to get NPM working…

Now I’m getting the following:

npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master https://github.com/mranney/node_pcap.git /root/.npm/_cacache/tmp/git-clone-2acb23d5
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-2acb23d5': Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-08-28T15_57_24_719Z-debug.log

Have you found a solution? I’m having the same issue.

I wish I did, I haven’t been able to figure it out, I think it’s above my skill level right now. I’ve thought about starting over with my entire build to get it working but I just don’t want to deal with that anytime soon. If you end up finding anything that works for you please feel free to share here? Thanks

This might be a reasonable replacement. I am not using it on a Pi but it does work. Easily installed with pip

1 Like

I finally got my Dasher to work! I found a post on the github page under the known issues, here’s what I did:

credit: https://github.com/maddox/dasher/issues/53

The issue is that nodejs is an old version when using the default package on Raspbian, so you have to upgrade to the latest version. The second issue I had above was installing npm as root (doesn’t work). Here were my steps:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libpcap-dev
sudo apt-get install npm
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install nodejs
git clone https://github.com/maddox/dasher.git
cd dasher
npm install