refactor getLatestNodeJSVersion