Updated build script to handle npm install, i.e. when the .git folder is missing