To install node on Linux, per the docs, I had to do:
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
I get the second statement, but not the first.
curl
will download the contents, right? Then pipe it to a a new command? Which does what? I know the -E preserves environment variables, but what does bash -
do?
And why do I need to do that, before doing apt-get
? Shouldn't apt-get
get me the latest version? Or is this always the way to do it with apt-get
?
apt install nodejs
is enough.