Code Monkey home page Code Monkey logo

Comments (6)

quavoce avatar quavoce commented on September 23, 2024 1

Ok, solved!

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) - I used a fresh Raspbian image and installed npm as Pi, and now the find_button command works. Here were my steps:

  1. Write a new 2016-09-23-raspbian-jessie.img image to an SD card
  2. Boot the Pi and SSH to it.
  3. Run these commands:
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

from dasher.

quavoce avatar quavoce commented on September 23, 2024

duh - I needed to use "sudo npm install" :)

Edit (don't use sudo - see my last post)

from dasher.

quavoce avatar quavoce commented on September 23, 2024

Ok, looks like it mostly installed ok, but there were errors:

pi@raspberrypi:~/dasher $ sudo npm install
npm WARN npm npm does not support Node.js v0.10.29
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/

> [email protected] install /home/pi/dasher/node_modules/socketwatcher
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.29"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/dasher/node_modules/socketwatcher/.node-gyp"
make: Entering directory '/home/pi/dasher/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/socketwatcher/build'

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

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.29"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/dasher/node_modules/pcap/.node-gyp"
make: Entering directory '/home/pi/dasher/node_modules/pcap/build'
  CXX(target) Release/obj.target/pcap_binding/pcap_binding.o
  CXX(target) Release/obj.target/pcap_binding/pcap_session.o
  SOLINK_MODULE(target) Release/obj.target/pcap_binding.node
  COPY Release/pcap_binding.node
make: Leaving directory '/home/pi/dasher/node_modules/pcap/build'
[email protected] /home/pi/dasher
└─┬ [email protected]
  ├─┬ [email protected]  (git+https://github.com/mranney/node_pcap.git#d920204745c8b00ef4b7a3fe27d902b263cdb70f)
  │ ├── [email protected]
  │ └── [email protected]
  └── [email protected]

And now when I try to run the find_button command, the following occurs:

pi@raspberrypi:~/dasher/script $ ./find_button

module.js:340
    throw err;
          ^
Error: Cannot find module '/home/pi/dasher/script/node_modules/node-dash-button/bin/findbutton'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
pi@raspberrypi:~/dasher/script $ sudo ./find_button

module.js:340
    throw err;
          ^
Error: Cannot find module '/home/pi/dasher/script/node_modules/node-dash-button/bin/findbutton'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

from dasher.

quavoce avatar quavoce commented on September 23, 2024

Looking to address the Nodejs being unsupported, it seems raspbian only has an old version:

pi@raspberrypi:~/dasher/script $ apt list -a nodejs
Listing... Done
nodejs/stable,now 0.10.29~dfsg-2 armhf [installed,automatic]

from dasher.

quavoce avatar quavoce commented on September 23, 2024

Hmm, so I was able to update to the latest nodejs, and install didn't give any errors, but the find_button still doesn't work. :(

pi@raspberrypi:~/dasher/script $ node -v
v0.10.29

pi@raspberrypi:~/dasher/script $ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -

## Installing the NodeSource Node.js v7.x repo...

pi@raspberrypi:~/dasher/script $ node -v
v7.3.0

pi@raspberrypi:~/dasher $ sudo npm install
pi@raspberrypi:~/dasher $

pi@raspberrypi:~/dasher $ cd script/
pi@raspberrypi:~/dasher/script $ ./find_button
module.js:472
    throw err;
    ^

Error: Cannot find module '/home/pi/dasher/script/node_modules/node-dash-button/bin/findbutton'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:420:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:535:3

(same for sudo ./find_button)

from dasher.

LimeBlast avatar LimeBlast commented on September 23, 2024

Hi @quavoce, I wanted to thank you for this. I had exactly the same problem, and this helped me solve it.

Just as a future note to myself (and anyone else that is trying to get this to work on a Raspberry 1), the first 4 steps above work fine, but the 5th doesn't (the processor in the Pi 1 isn't powerful enough for node 7, or something like that), so instead you need to install node 4 using:

wget http://node-arm.herokuapp.com/node_latest_armhf.deb 
sudo dpkg -i node_latest_armhf.deb

After this you can go ahead and complete all the other steps, which should work correctly.

from dasher.

Related Issues (20)

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.