diff --git a/script/download-git.js b/script/download-git.js
index <HASH>..<HASH> 100644
--- a/script/download-git.js
+++ b/script/download-git.js
@@ -4,7 +4,7 @@ const ProgressBar = require('progress')
 const tar = require('tar')
 const https = require('https')
 const { createHash } = require('crypto')
-const { rm, mkdir, createReadStream, createWriteStream, existsSync } = require('fs')
+const { rm, rmdir, mkdir, createReadStream, createWriteStream, existsSync } = require('fs')
 
 const config = require('./config')()
 
@@ -101,7 +101,8 @@ if (config.source === '') {
   process.exit(0)
 }
 
-rm(config.outputPath, { recursive: true, force: true }, error => {
+// Node 12 didn't have rm, only rmdir
+;(rm || rmdir)(config.outputPath, { recursive: true, force: true }, error => {
   if (error) {
     console.log(`Unable to clean directory at ${config.outputPath}`, error)
     process.exit(1)
It's called rm in Node <I>