The tar file I downloaded is a binary (not source) distribution. I read an article that said to run tar --strip-components 1 -xzf in /usr/local but if I do this I cant see an simple way to remove everything when I want to upgrade the version later. I could un-tar it with the prefix intact, i.e. tar -xzf but i'm not sure which environment variables would need to be set to get man pages and everything else working, at minimum I guess I would need to set the path. Is there a 'best practice' for this kind of installation?
The best way to install node is described on the official website.
The setup script will create a
/etc/apt/sources.list.d/nodesource.list to update the installed package version .
You can see the content of the
curl -sL https://deb.nodesource.com/setup_6.x
There are may features :
- adding a NodeSource signing key
- automatic update
- check your system to install the appropriate package to your OS
- Install the required package (
- It is safe than installing a node tar file.