Friedrich Ewald My Personal Website

Installing nodeJS and setting up an alias

Under Ubuntu 14, installing nodejs is relatively easy. At first one needs to to the obvious sudo apt-get update followed by a sudo apt-get install nodejs With this two easy steps you have a nodejs installation on your system which you could easily check with node -v. If the installation was successful, this command prints the current installed nodejs version. In my case this was the version v0.10.25 which is a bit outdated but could be sufficient if you do not plan to serve files or sites over the internet. In this case you should install the latest version from directly because of some severe security issues with the older versions. In my case it was not done with installing node because the directory, where nodejs was installed to nor was in the PATH neither there was a symlink to nodejs. For some reason, some programs rely on node, others rely on nodejs. So the goal was to use the same program for each command and also make it available in the PATH to access it directly. After asking stackoverflow, I was proposed to create an alias in the .bashrc file like this:

alias nodejs='/usr/bin/nodejs'
Conclusion: Do not change the path, change the bash profile as the path easily can break since it depends on the order of the different folders.

About the author

is an experienced Software Engineer with a Master's degree in Computer Science. He started this website in late 2015, mostly as a digital business card. He is interested in Go, Python, Ruby, SQL- and NoSQL-databases, machine learning and AI and is experienced in building scalable, distributed systems and micro-services at multiple larger and smaller companies.