Exit with the correct error code

Stop npm scripts when build fails