I can only install node 18 when I run the commands. But v16 is not supported. When I try to use nvm to install v16, the folder and permission are not correct again. The npm is installed in my user folder and the directory is not readable by other users. Look like it’s not working.
I can’t find a way to install node.js v16 (which can be used by Ghost) in Ubuntu 22.04.
I migrate from Digital Ocean Ubuntu 16.04 to Ubuntu 22.04. Can I know when node 18 lts is supported soon? If v18 is going to be supported soon, I’ll just wait for it. It saves the hassle of upgrading node
I tried to run sudo apt install nodejs=16 in the new Ubuntu machine. I didn’t run apt-get update before.
this is what I get: E: Version '16' for 'nodejs' was not found
Then I tried to run sudo apt install nodejs node -v
It gives v18.7.0
I wouldn’t know since I am a community member, too.
Nonetheless, you first need to setup Apt to install Node 16.
Since you have done a distribution upgrade, and Node was already installed, the latest version for the LTS was installed during the upgrade.
You could try completely removing Node and starting again.
Finally, do make use of DO snapshots; they’re there to help during updates and upgrades. For a few cents you can clone and test the steps, and rollback when things go awry.
I was trying to migrate manually from a ubuntu machine to another one. So it’s not done with do-release-upgrade. I created a new ubuntu 22.04 machine on DO and set it up.
I was installing node with apt-get so it didn’t come with the new ubuntu machine. After installing node v18, I try to remove the installed node with apt remove and reinstall again. But it’s still the same.
The Ubuntu and Debian node versions in apt are slow, and some node apps need more precision. I’ve used n to manage a number of hosts for several years.
One gotcha - make sure to remove the Debian/Ubuntu node package, as you may end up confused by multiple versions.