To install the latest version of Node.js (18.13.0) on Debian 11, you can use the Node.js package manager (npm) that comes with Node.js.
Here’s one way to do it:
- Download the Node.js package from the Node.js website:
curl -sL https://deb.nodesource.com/setup_18.x | bash –
- Install Node.js:
apt-get install -y nodejs
- Confirm that Node.js was installed correctly by checking the version:
This should output ‘v18.13.0’ or a newer version if it’s available.
Alternatively, you can also use a package manager like nvm (Node Version Manager) to manage and install different versions of Node.js on your system.