Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 4159  / 2 Years ago, tue, september 13, 2022, 5:49:29

What is the difference between installing node.js with 'sudo apt-get install nodejs' or downloading the Linux Binaries (.tar.gz) and following these instructions?



Is the outcome the same?


More From » 14.04

 Answers
5

Installing from source has one pitfall, that removing (and otherwise keeping track of installed files) becomes difficult. It's best to let the package manager handle the installation. You can use this PPA and then apt-get will get you the latest version.



sudo add-apt-repository ppa:chris-lea/node.js 
sudo apt-get update
sudo apt-get install nodejs





The PPA has since been moved to another source. The instructions from the NodeJS Github wiki:



curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs


The commands, condensed out from the script:



sudo apt-get install apt-transport-https lsb-release curl 
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
sudo sh -c "echo 'deb https://deb.nodesource.com/node $(lsb_release -sc) main' > /etc/apt/sources.list.d/nodesource.list"
sudo sh -c "echo 'deb-src https://deb.nodesource.com/node $(lsb_release -sc) main' >> /etc/apt/sources.list.d/nodesource.list"
sudo apt-get update
sudo apt-get install nodejs

[#23682] Tuesday, September 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
freezidepu

Total Points: 394
Total Questions: 105
Total Answers: 118

Location: Libya
Member since Mon, Dec 7, 2020
3 Years ago
freezidepu questions
Tue, Apr 19, 22, 16:03, 2 Years ago
Fri, Nov 11, 22, 18:04, 2 Years ago
Sat, Mar 18, 23, 10:59, 1 Year ago
;