Friday, April 19, 2024
22
rated 0 times [  22] [ 0]  / answers: 1 / hits: 17440  / 2 Years ago, wed, january 5, 2022, 1:00:02

How can I install Node.js and MongoDB so they are the most current versions? The available versions from package manager are not up to date, and PPA from Chris Lea for Node.js doesn't get updated on a regular basis.


More From » software-installation

 Answers
7

The packages in the Advanced Packaging Tool (AptGet) do not work always or are outdated at times on Ubuntu. I suggest building Node.js from source and installing the recommended .deb package for Ubuntu provided by MongoDB.






Video Demo:



http://youtu.be/SWztoBP7RQQ








Requirements



These are needed for building and running.



sudo apt-get install build-essential lamp-server^





Build & Install Node.js



Node.js can easily be installed from its source package located on the front page of nodejs.org. It allows you to build the most compatible package for install.



Note: I recommend not installing the Linux Binaries for your system architecture (ie. x32, x64) as they are missing components you may require such as NPM.



Node.js Front Page



You can right click on the INSTALL button to copy the source package link and do the following also in your terminal console.(Example shows how to install current version as of 07-31-2014)



wget http://nodejs.org/dist/v0.10.30/node-v0.10.30.tar.gz


Decompress and enter the directory.



tar -xvzf node-v0.10.30.tar.gz
cd node-v0.10.30


Configure the make file for your machine then build and install as a root user.



./configure
make
sudo make install


Test to make sure it was installed.



node -v


You have also installed the Node Package Manager. Type the following to see items that were installed with version numbers:



npm version





Install Recommended MongoDB Package



MongoDB documentation suggest installing the .deb package provided by them for the latest versions as long as you are using running and Ubuntu over 9.10 "Karmic". Doc: Installing on Ubuntu



Acquire key:



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


Acquire source list:



echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list


Update package manager and install:



sudo apt-get update && sudo apt-get install mongodb-org


Test if MongoDB shell runs:



mongo


Press Ctrl+C to exit.



Note: mongo-10gen can be updated and upgraded from AptGet. You do not need to perform the install action again unless you remove it.


[#30077] Thursday, January 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
herriail

Total Points: 11
Total Questions: 122
Total Answers: 118

Location: Peru
Member since Tue, Mar 16, 2021
3 Years ago
herriail questions
Tue, May 18, 21, 02:11, 3 Years ago
Sun, Dec 12, 21, 06:06, 2 Years ago
Wed, May 24, 23, 01:42, 12 Months ago
Sun, Jan 29, 23, 00:48, 1 Year ago
;