Get started with Node.js (Installation and Hello World Application)
A lifelong learner. Love to travel. Listen to music.
Search for a command to run...
A lifelong learner. Love to travel. Listen to music.
No comments yet. Be the first to comment.
Source Code ScreenCast Intro Here we are going to create a minimal node package. It will contain only two methods. If you think this is a rocket science, then let's build one and have fun. The most interesting matter is, it would take less than 5 m...
Best Practices for Path Structure, Versioning, and Error Handling

Understanding the Performance Implications of async and defer Attributes

Overview static: Default position. It does not allow setting properties like top, bottom, left, right, z-index relative: Acts the same as static. but allows positioning it relatively by putting properties like top, bottom, left, right, z-index absolu...

Overview When an element in the browser has a conflict of styles, the browser uses a set of rules to determine which style should be rendered. This set of rules is defined as CSS Selector Specificity. For instance, for an element, if we have the foll...

Master block, inline, flex, and grid to build better web layouts

Welcome to Javascript world.
The popularity of javascript has brought dramatically changed in app development paradigm. And server-side development revolution started with the Node.js. According to the node.js official site, Node.js is
Asynchronous event driven JavaScript runtime, Node is designed to build scalable network applications.
In this article, we
Install Node.js in your system.
Run a Hello world application in your application.
There are several ways to install node.js in your system.
Using the official Node.js site.
Using nvm (Recommended and we will discuss the procedure here in details)
nvm is a Node Version Manager, available for Linux and Mac. Also, there is a version available for windows user from separate developers.
If you are a Linux or Mac user, stay with me. Windows user, please go to the next section.
Please install the curlif not installed.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
Or wget, the preinstalled download manager
In case your Linux distro does not ship with curl use default wget download manager.
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
Now set the environment variable and load nvm
export NVM_DIR="${XDG_CONFIG_HOME/:-$HOME/.}nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Now, restart your terminal and update
source ~/.bashrc
So now, nvm must be installed in your system.
Go to the download page and install your machine.
Linux/Mac user run the command
command -v nvm
This should output the nvm
To install the latest version of node, just run
nvm install node
To install a specific version of node
nvm install version
Replace version with your desired node version
In this section, we will create a console app, hello world
Create a file in your machine named index.js
In your index.js file, write
console.log('Hello World!!!');
Go to terminal and run
node index.js
Voila!!, you just run your first node.js application.
Your terminal should output
Hello World!!!
Get available node.js list By,
nvm ls-remote
Switch to the specific node.js version by,
nvm use version
NB: Before switch to a specific version, install that version nvm install version
Stay tuned and if there is a confusing term or something, make the response below. I will replay ASAP.