What is Node.js?
Node.js is an open source javascript-based framework/platform runs on top of Google chrome's V8 JavaScript engine. It's cross-platform. It’s written in C++ and is used in Google’s Chrome browser. It uses an event-driven, non-blocking I/O model. Here the two methods are provided for installing Node.js in Ubuntu
There are several different ways you can install Node.js on your Ubuntu environment. They are
User with sudo permission or sudo command is required
You can find all the versions of Node.js downloadable file over here
1.) Install Node.js with APT Package Manager
To install Node.js, type the following command in your terminal
Check the installed node.js by typing,
Node.js is an open source javascript-based framework/platform runs on top of Google chrome's V8 JavaScript engine. It's cross-platform. It’s written in C++ and is used in Google’s Chrome browser. It uses an event-driven, non-blocking I/O model. Here the two methods are provided for installing Node.js in Ubuntu
There are several different ways you can install Node.js on your Ubuntu environment. They are
- APT Package Manager
- Ubuntu Packages
PREREQUISITE
You can find all the versions of Node.js downloadable file over here
1.) Install Node.js with APT Package Manager
To install Node.js, type the following command in your terminal
sudo apt-get install nodejs
Then install the Node package manager, npm:
sudo apt-get install npmnpm allows you to install node modules and packages to use with node.js
Check the installed node.js by typing,
nodejs --version
For npm version type
npm --versionNote: The above method will not install the latest version of node.js if you want the latest version of node.js, go to the next method
2.) Install Node.js with Maintained Ubuntu Packages
Add the Node.js-maintained repositories to your Ubuntu package source list with this command:curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
Make sure to replace 8.x with the correct version
Then install Node.js with apt-get:
sudo apt-get install nodejs
The Node.js package contains the Node.js binary as well as npm, so you don't need to install npm separately. However, in order for some npm packages to work (such as those that require building from source), you will need to install the build-essentials package:
sudo apt-get install build-essentialCheck the versions of node.js and npm by typing,
nodejs --version (or) node --version
npm --versionHow to uninstall nodejs?
sudo apt-get remove node
sudo apt-get remove npm
Comments
Post a Comment