update node.js

Hi All

Is there a way to update node.js to the latest version of the 14.x branch… im on latest dietpi… however
node.js is says it version 14.0.0 and latest is 14.15.0… however i do not want to be upgraded to the 15.0.0 branch.

which why i was asking… some one posted a shell script from last year however that goes to the Latest node folder so will get v15.

Thanks,

Hi,

many thanks for your request. There is no automated way to perform this. You would need to download the correct archive fitting your architecture from https://nodejs.org/dist/v14.15.0/ and unzip it to /usr/local/

thanks Joulinar

i took a look at the dietpi-software and was able to do the following.

INSTALL_URL_ADDRESS=‘https://raw.githubusercontent.com/MichaIng/nodejs-linux-installer/master/node-install.sh
G_EXEC curl -sSfLO “$INSTALL_URL_ADDRESS”

edited the node script to for Raspberry PI (armv7l) condition and changed the URL line to point to the v14 folder
it would otherwise download v15… apparently node-red prefers v14.x

elif [[ $ARCH == ‘armv7l’ ]]
then
URL+=‘latest-v14.x/’
NAME=$(curl -sSf “$URL” | grep -o ‘"node-v[0-9.]*-linux-armv7l.tar.gz’)


then did

G_EXEC chmod +x node-install.sh
G_EXEC_OUTPUT=1 G_EXEC ./node-install.sh


it then did the install

and now i can see it is on V14.15.0

cheers :slight_smile:

yeah node.js is quite a simple installation. Basically it’s just downloading an archive and have it extracted.

Node also has the version management tool n:

npm i -g --unsafe-perm n
n 14