

Node (18/stable) 18.12.0 from OpenJS Foundation (iojs**) installedĪnd as you can see, it gave me Node.js 18.12! Install the most recent build of Node.js So let's start with installing the stable release: Install stable release of Node.js using snapĪs always, it only requires single command when installing snap packages and the same goes for Node.js: sudo snap install node -classic :~$ sudo snap install node -classic Snaps come pre-configured in Ubuntu and you can install Node.js as a snap package and also allows you to choose between stable and edge releases. Alternative: Install Node.js in Ubuntu using snap :~$ node -versionīash: /usr/bin/node: No such file or directoryĪnd it should give you similar results after the removal process. You can always check for the installed version to check whether you successfully removed Node.js or not. Whether you went with LTS or non-LTS, the uninstallation method remains the same and only needs a single command: sudo apt purge -auto-remove nodejs Yep, it is one iteration behind the most recent version but stability is the key factor here. Now, you can proceed with the installation by the given command: sudo apt-get install -y nodejsĬheck the node version to ensure that it is installed correctly. You just have to download a different script this time.

This is recommended to most users as it gets the job done with enhanced stability.

V19.0.0 Install the LTS version of Node.js

It should show the version of currently installed Node: :~$ node -version You can verify that Node is installed on your system with: node -version Since everything else is taken care of, you just need to install nodejs package now. The script takes care of adding the node repository to your system, its signing key to your keyring and updating the package cache. While writing, Node.js v19.x is the most recent (stable) release but the given instruction should remain the same as they will fetch the most recent release rather than pointing to the specific one.ĭownload the setup script provided by Node.js developers and run it instantly with: curl -fsSL | sudo -E bash You'll be using it for downloading a bash installer script provided by Node developers. Oh, wait! You need to make sure that curl is installed on your Ubuntu system. Sounds good? Make up your mind about the Node version you want to install and follow the instructions below. I'll discuss that method in the later sections of this article. You can also use Snap for installing Node on Ubuntu. Since you'll be adding their repository to the system, you'll also get updates on the installed Node.js version directly from the source. Looking to get Node.js on your Ubuntu system? You can get it directly from the developers of Node.js.
