update node.js Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
kazgor
Posts: 30
Joined: Sun Dec 17, 2017 10:18 pm

update node.js

Post by kazgor »

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,
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: update node.js

Post by Joulinar »

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/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
kazgor
Posts: 30
Joined: Sun Dec 17, 2017 10:18 pm

Re: update node.js

Post by kazgor »

thanks Joulinar

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

INSTALL_URL_ADDRESS='https://raw.githubusercontent.com/Micha ... 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 :)
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: update node.js

Post by Joulinar »

yeah node.js is quite a simple installation. Basically it's just downloading an archive and have it extracted.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2422
Joined: Sat Nov 18, 2017 6:21 pm

Re: update node.js

Post by MichaIng »

Node also has the version management tool n:
```
npm i -g --unsafe-perm n
n 14
```
Post Reply