Check for nodejs first to increase predictability

On the debian based systems, if the other node app is installed it will break this script by making it think that nodejs is at node, but that's actually another app by the same name. By checking first if nodejs exists, you get around this problem as you never check for the less popular node app that doesn't work and nodejs is less likely to be a conflicting app.