Rik's Ramblings

Friday, December 14, 2018

Scary times in the pcduino world today...

I bought a couple of pcDuino boards a few years ago. These seem to be discontinued and obsolete hardware now, but I'll be buggered if I'm going to throw them away!

I came a little unstuck today trying to use one to run a nodejs service. A while back I blogged that I managed to get node running on the board. Recently I wrote some nodejs module that fetches data from the internet and writes it to the /tmp/ directory on the pcDuino.

I wanted to update the version of nodejs on the pcDuino, so I could use the let keyword (rather than var).

Ended up getting myself down a rabbit hole where I had no working version of node on the device - and ofcourse, couldn't remember how to re-install the old version.

Anyway, here's something I found out that may be useful to other people using obsolete hardware!

Tried to install the latest version of "n" from npm
cd /tmp
npm install n

Didn't use the "-g" option as I didn't want to get myself stuck with an incompatible version of node.

Couldn't install anything as the version of SSL on the pcDuino is obsolete too!

This helped:
npm config set strict-ssl false

NOTE: probably not a good idea to leave this flag set this way!

Sadly the next step really screwed me:
sudo /tmp/node_modules/n/bin/n latest


Luckily I managed to recover using this:
sudo /tmp/node_modules/n/bin/n 5



I think when the newer versions of node try to install they need to compile something, and they require a version of the C++ compiler/libs that aren't available on the pcDuino. I have no idea if I'd be able to build those libs for the pcDuino and I don't want to go down that rabbit hole. But for now, using version 5 of node seems to work!

My node is now reporting version 5.12.0 (rather than 0.10.x)
My npm is reporting 3.8.6

Hopefully this will be good enough to get my stupid project out the door!

See also:



Labels: , , ,

0 Comments:

Post a Comment



<< Home