Installing usable version of Node

I’m trying to get the prototype of our Internet Archive server onto Rachel 3,

First problem was node … all the typical ways of installing node such as : sudo apt-get install nodejs get node4.2.6

Even following [https://askubuntu.com/questions/786272/why-does-installing-node-6-x-on-ubuntu-16-04-actually-install-node-4-2-6] didn’t work, it still only allowed installing node 4.2.6 which is so ancient that pretty much none of the npm modules work with it.

Node is currently at version 10, so I’d hope we could at least get up to version 9.

Any ideas - my own attempt at an apt upgrade mucked up the device so I’m a little reluctant to experiment again.

@Steve - @edresor suggested this was a question for you.

Do newer versions of node require a 64-bit OS perhaps? I don’t know the answer to your question, purely speculating.

Actually I managed to get Node v 9.11.2 on it, I had to repeat the steps in [https://askubuntu.com/questions/786272/why-does-installing-node-6-x-on-ubuntu-16-04-actually-install-node-4-2-62] sometimes multiple times, it was weird that sometimes they didn’t seem to take. And I was unable to get v10 onto it, but that’s ok.

1 Like

Note that

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

If you look at the output, it implies to me that 10.x should work but then when you run

sudo apt-cache policy nodejs

It is still restricted to 9.11.2 .

This would be a good thing for whoever looked after getting the distro onto Rachel to look into, as it would be good if it shipped with a current node to save users having to do this.

@jeremy is there anyone on the team who is familiar with the unix distro being used, hardware etc at enough of a detail to help ?

https://github.com/nodejs/build/issues/885 suggests you might be right about Node10.x and 32 bit systems, and I’m presuming that the Rachel 3+ is a 32 bit system (I don’t know how to check that)

Problems we are hitting is that more and more packages are dependent on node 10.x so we currently can’t get our system to install on node 9.x which means we can’t put it on Rachel 3+ :frowning:

Any suggestions before we move to one of the Raspberry Pi solutions (we might see other problems there, but at least there seems to still be a support community for the smaller AMD processers) and there doesn’t seem to be anyone we can find who even understands what is on the Rachel 3+ box.

Hi Mitra,

Rachel Plus 3 is running 32-bit (root@CMAL-a788:~# getconf LONG_BIT). Also, I took a look at the issue per your link. I see discussions regarding dropping 32-bit support post v8, but didn’t get far enough to see the outcome.

Though I haven’t used node on Racel just yet. I was able to install Node10.0.0, after initially installing v4.2.6:

root@CMAL-a788:~# nodejs -v
v4.2.6
root@CMAL-a788:~# npm -v
5.6.0
root@CMAL-a788:~# nvm use 10.0.0
Now using node v10.0.0 (npm v5.6.0)

I can put together a bash script if you like.

That would be great - I’ve also got someone from the nodejs team who is going to do a cross-compile to 32 bit, so I’m not sure what version of 10 its using, since he didn’t seem to think it existing in 32 bit. I just set him up today with access to one of our boxes to use for the cross-compilation.

I’m going to see if I can update to rev 10.2.1. That is the last rev with npm 5.6.0. I will provide a script then (later today, or tomorrow). Please share what the note team provides. I’m guessing it will be something that goes past the 10.2.1(?) on Ubuntu 16.04/32-bit.

Sure - will do, I played around with this a bit

touch .bashrc
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
# Restart terminal window, or run next three lines
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
# Install and compile from source
nvm install 10.13.0

I had previously done

sudo apt-get update && sudo apt-get install gcc g++ make 

and at least g++ was used by nvm.

This resulted in a node that reports the correct version number, I’m about to try and use it to install some packages that depend on node 10.* so we’ll see how it goes.

Raphael from the node team finally got an unofficial build up at https://unofficial-builds.nodejs.org/download/release/v12.1.0/ I’ve no idea what to do with it (I also heard v12 is still a bit unstable, and I notice https://unofficial-builds.nodejs.org/download/release/v10.16.0/ is there as well.

Hi Mitra,

Thank you for the follow-up. I will check it out when I have a chance. I am sure having a node install option will come in handy.

Node is already installed in the default Rachel - the problem is that its such an old version (v4) that it makes any modern code unrunnable. Instead of an option, I think the best thing would be to replace it (in the default release) with the current LTS version (v10)

But then, I don’t know what the constraints are that have Rachel shipping with such an old version of the OS.