Wednesday, December 21, 2016

node js and npm remove and install


Step 1 - Remove nodeJs & npm at Ubuntu 16.04

cd /usr/local
sudo rm -r bin/node bin/npm include/node lib/node_modules share/man/man/node.1
cd
rm -r .npm

OR

sudo apt-get remove nodejs
sudo apt-get remove npm

Step 3 - Install Latest Version of NodeJs & npm

update the repository with the apt command:

sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm

Install MongoDB on Ubuntu 16.04

Step 1 - Importing the Public Key

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

Step 2 - Create source list file MongoDB

Create a MongoDB list file in /etc/apt/sources.list.d/ with this command:
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list

Step 3 - Update the repository

update the repository with the apt command:

sudo apt-get update

Step 4 - Install MongoDB

Now you can install MongoDB by typing this command:


sudo apt-get install -y mongodb-org

Step 4 - Run mongo

Now you can install MongoDB by typing this command:


sudo service mongo start