Can Node.js version be checked with AppleScript?
I have node installed in the directory /usr/local/bin, so this command will return the version:

do shell script "/usr/local/bin/node -v"




A couple other scripting points:


You needn't use System Events to obtain the user's username.  If all you need is the username, you can use

short user name of (system info)

However, it looks like you were trying to get the path to your user home folder.  In AppleScript, this can be done like so:

POSIX path of (path to home folder)

However, as that was all going to be plugged in to a do shell script command, none of that is necessary, as you can use ~ to denote your home folder, and the shell will automatically expand this for you (provided it's not inside any quotes):

do shell script "cd ~/.nvm/"

There's no need to set result to.  result will automatically contain the result of the previous AppleScript command.  return result will work fine without needing to set result to.