Move the node.js version check to before `npm install`.

`npm install` will fail for some old node versions because it can't satisfy the version requirements for our packages.