I installed Raspberry Pi Desktop on an old laptop and then I installed nodejs using 'sudo apt install nodejs'. After that, when I verify the version of node, using 'node -v' or 'nodejs -v' I get 'v10.24.0'. Then I try upgrade the Nodejs version but it doesn't work because whatever way I used to upgrade, the version stays the same.
I try this:
pi@local-server-raspi:~ $ sudo su -
root@local-server-raspi:~ # apt-get remove nodered -y
root@local-server-raspi:~ # apt-get remove nodejs nodejs-legacy -y
root@local-server-raspi:~ # apt-get remove npm -y
root@local-server-raspi:~ # curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
root@local-server-raspi:~ # apt-get install nodejs -y
root@local-server-raspi:~ # node -v
v10.24.0
root@local-server-raspi:~ # npm -v
bash: npm: command not found
I also try with nvm but with the same result, when I type 'nodejs -v' I get 'no such file or directory' and when I type 'node -v' I get the same version, 10.24.0.
I appreciate it if any of you have some idea how to upgrade the version of the nodejs to the LTS version, 14.16.1.