Showing posts with label NodeJs. Show all posts
Showing posts with label NodeJs. Show all posts

Wednesday, October 23, 2019

Installation of Node Package Manager in Ubuntu

Hi,

In this blog article I would like to discuss the installation procedures for installing Node Package Manager shortly called as NPM in ubuntu.

Prerequisites
Name Version Download Page Direct Link
Node 12.13.0 LTS Node Package Manage Download Page Click to Download Directly

This post mainly focuses on installation of Node-12.13.0 LTS and its working, the procedures followed for the installation of this version and the forth coming version of Node would remain the same.

Using the links given above in the prerequisite section download the package in one of your preferred locations and extract it.

Open up a terminal and execute the following commands one after the other...

Moving the prompt to the user's home directory
> cd

Editing the .bashrc file using gedit
> gedit .bashrc

In case if you do not have gedit text editor, you can use any text editor of your choice

Append the file with the following lines
NODE_HOME=<INSTALLATION-PATH-OF-NODE>
PATH=$PATH:$NODE_HOME/bin

* installation path is the location where you have extracted the node tar package

With that we have concluded the installation of Node

Use the following command to verify that the installation has happened correctly....

> which node
the above command would return the path of the executable as something shown in the picture given below...


> node --version
the above command would return the version of Node installed as given in the image below....


> which npm
the above command would return the path of the executable as something shown in the picture given below...


> npm --version
the above command would return the version of NPM installed as given in the image below....


With this we have concluded the installation of Node and NPM in Ubuntu.

Hope you had great time reading...

Ciao

Tuesday, October 22, 2019

How to completely remove NodeJs and NPM in Ubuntu

Hi,

In this post I am going to write about how to completely remove NodeJs and NPM from ubuntu.... I was having Ubuntu-16.04 as my operating system during installation of NodeJs and NPM, this procedure should be fine for future versions and to some extent recent past versions of ubuntu

With that said, lets get into action

Assuming you have installed NodeJs and NPM using apt-get, the following is the procedure to completely remove NodeJs and NPM from your presonal computer....

Open up a terminal, and fire the command below...
> sudo apt-get update
The above command will make the local repository in sync with the remote repository for the other commands to have a smooth process.

Once the update is done, fire the following commands one by one at the terminal

Removing NodeJs

> sudo apt-get purge --auto-remove nodejs
> sudo apt-get purge nodejs
> sudo apt-get autoremove

The above commands ensures the removal of NodeJs but it will not ensure the removal of files installed during installation, after the removal of NodeJs there would be some files left orphan in the system, to remove those file(s) proceed with the following commands...

> sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp /opt/local/bin/node opt/local/include/node /opt/local/lib/node_modules

To remove node or node_modules from /usr/local/lib
> sudo rm -rf /usr/local/lib/node*

To remove node or node_modules directories from /usr/local/include
> sudo rm -rf /usr/local/include/node*

To remove any node file or dir from /usr/local/bin
> sudo rm -rf /usr/local/bin/node*

Removing Node Package Manager
To remove NPM, fire the following commands at the prompt...

> sudo apt-get purge --auto-remove npm
> sudo apt-get purge npm
> sudo apt-get autoremove

Well with this I conclude this post, if you find any discrepancies please comment it in the comment section below....

As always, hope you had good time reading...

Ciao.

Installing Python and Creating Virtual Environment for Pip for package installations in Ubuntu

Hi, In this post we are going to look at how to install Python and PIP and installing packages in virtual environments.. Without wasting...