![]() ![]() ![]() That’s it, you have successfully installed and configured Node.js on Ubuntu 22.04. To test your sample, run the following command: Create a HelloWorld.js file and paste the following code into the file:Ĭonst http = require('http') const hostname = '127.0.0.1' const port = 3000 const server = http.createServer((req, res) => ) To test your Node.js installation, write a Hello World application. Mkdir : /home/ubuntu/n/n/versions/node/18.1.0 To install the latest GA version of Node.js: To install the LTS version of Node.js, type in the following command: IMPORTANT: OPEN A NEW TERMINAL TAB/WINDOW or run `. It can also be used in the development stage, it also makes it quick to. Step 2 - Install Node.js on Ubuntu After successfully adding the PPA to the system, execute the command below to install Node on Ubuntu: sudo apt-get install nodejs Step 3 - Verification To verify any installation, check the version number of the installed software. Mkdir : /home/ubuntu/n/n/versions/node/16.15.0 The primary purpose of this is to install node programs. Installing the requested Node.js version(s). Installing helper scripts in '/home/ubuntu/n/bin'. ![]() Shell initialization file '/home/ubuntu/.bashrc' updated. Running local n installation to '/home/ubuntu/n/bin'. Your shell, bash, IS supported, and the following initialization ensure that $N_PREFIX/bin is in the $PATH Initialization file will be modified in order to: If your shell is bash, bsh, zsh, fish, or pwsh (PowerShell), the relevant '-' means that *no* version will be installed: 'latest' to the latest available version. 'lts' refers to the LTS (long-term support) version, This step ensures that the installation was successful and that Node.js is ready for use. Once the installation completes, it’s always a good idea to verify the version of Node.js installed. You are ABOUT TO INSTALL n, the Node.js VERSION MANAGER, in:Īfterwards, THE FOLLOWING Node.js VERSION(S) WILL BE INSTALLED,Īnd the first one listed will be made active This command installs Node.js from the NodeSource repository: sudo apt install nodejs Step 5: Verifying the Node.js Installation. To install n on Ubuntu, use the following bash script: At the time of creating this tutorial, the latest release of Node.js was 16.15.x and the latest GA release was 18.1.x.īefore installing Node.js you have to install a tool to manage multiple Node.js installations. ![]()
0 Comments
Leave a Reply. |