2

I'm currently trying to communicate with Arduino through a web server created with Node.js installed on my Orange PI PC. In order to do this, I tried to use the module called johnny five, but the only output I receive is a bunch of errors.

I'm using Raspbian v0.8.0 for Orange PI PC.

I installed node v0.10.0 by using wget plus the link. Then, I unpacked the file by using:

cd /usr/local
sudo tar xzvf ~/node-v0.10.0-linux-arm-pi.tar.gz --strip=1

The version of node is 0.10.0 and the NPM's version is 1.2.14. When I tried to update the npm with the command npm install npm -g these errors came in

Then, I tried to install johnny-five by following the guide that I've found on the johnny-five website which is linked to Github And this happened

If I try to run a program, many error appear saying at the top of them 'cannot find module johnny five'.

This version of node is the only one that works for me after checking many other of them.

Nathan
  • 8,093
  • 8
  • 50
  • 76
filyps98
  • 21
  • 3
  • don't provide the screenshots, it's better to provide the code snippets and errors explicitly, as the links will go obsolete and are not comfortable to work with. – Farside Aug 22 '16 at 14:52

2 Answers2

0

Try and set up a more advanced version of node.js. I had success with node v4. This will update NPM/Node.

# install updates
sudo apt-get update && sudo apt-get upgrade
# install node
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
# test
node -v
npm -v
# clone the code of the project in a folder and continue normally 
qballer
  • 2,033
  • 2
  • 22
  • 40
  • It doesn't work, maybe because the updated raspian version is not compatible with orange pi. These are the errors: `The following packages have unmet dependencies: nodejs : Depends: libc6 (>= 2.16) but 2.13-38+rpi2+deb7u11 is to be installed Depends: libstdc++6 (>= 5.2) but 4.7.2-5+rpi1 is to be installed E: Unable to correct problems, you have held broken packages.`. – filyps98 Aug 27 '16 at 17:12
  • can you install the OS with noobs ? https://www.raspberrypi.org/documentation/installation/installing-images/ – qballer Aug 28 '16 at 13:50
  • I've used win32DiskImager to install the OS. The problem was that the OS is an unofficial version of raspbian. Now i've installed debian jessie and i managed to make johnny-five work without errors even though the orange pi doesn't recognize the arduino. – filyps98 Aug 30 '16 at 12:39
0

You can find an old version in the Heroku web:

https://node-arm.herokuapp.com/

But if you want a more recent go to https://nodejs.org/en/download/ and dowload a new one from Linux Binaries (ARM). Unzip the binary archive to any directory you wanna install Node, I use /usr/lib/nodejs: sudo mkdir /usr/lib/nodejs sudo tar -xJvf node-v8.9.4-linux-armv7l.tar.xz -C /usr/lib/nodejs sudo mv /usr/lib/nodejs/node-v8.9.4-linux-armv7l /usr/lib/nodejs/node-v8.9.4

Set the environment variable ~/.profile, adding below to the end: # Nodejs export NODEJS_HOME=/usr/lib/nodejs/node-v8.9.4 export PATH=$NODEJS_HOME/bin:$PATH

Refresh profile: .~/.profile

Test installation using:

node -v

and

npm version

manuti
  • 23
  • 1
  • 6