0

I understood that the command to install nodejs using the terminal and provided below

`sudo apt-get install nodejs`

will install nodejs in the root repository of my ubuntu. I am confused on how to install it to another custom location of my choice and will the common cd commands would do the job for me after changing the directory location to another place of my wish? Thanks in advance :)

Jishnu
  • 151
  • 1
  • 2
  • 12
  • I am not sure what you mean by "the root repository of my ubuntu", but the command you mentioned installs node.js system-wide, so it will be available everywhere in your system. If you want to install node.js on another machine just repeat the command or use a node version manager to install and manage node.js. – Sergey Nov 09 '20 at 18:17
  • Sorry for the confusion created I was just confused whether it will installed in the space where I have allocated for the Ubuntu OS ( in SSD around 100GB for the root) or somewhere in my home directory( which is in my HHD) if I use the above method for installation. – Jishnu Nov 10 '20 at 18:11

1 Answers1

1

See here: How can I change the apt-get install directory

To do what it sounds like you want to do, download the tarball from nodejs.org and install that way.

I would highly recommend against doing that though. There's nothing wrong with apt installing into the "root" and is standard practice.

Dani-rae
  • 36
  • 4