From ac6318b5319d6ca0b3a5b274f79dddcf50a69ef2 Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 12 Jan 2022 23:41:12 +0000 Subject: [PATCH] Replace rimraf with rmdir in postinstall Otherwise when you install for production this errors since rimraf is a development-only module. --- extensions/postinstall.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extensions/postinstall.js b/extensions/postinstall.js index 50f3e1144f805..547f406af3476 100644 --- a/extensions/postinstall.js +++ b/extensions/postinstall.js @@ -8,7 +8,6 @@ const fs = require('fs'); const path = require('path'); -const rimraf = require('rimraf'); const root = path.join(__dirname, 'node_modules', 'typescript'); @@ -21,12 +20,12 @@ function processRoot() { if (!toKeep.has(name)) { const filePath = path.join(root, name); console.log(`Removed ${filePath}`); - rimraf.sync(filePath); + fs.rmdirSync(filePath, { recursive: true }); } } // Delete .bin so it doesn't contain broken symlinks that trip up nfpm. - rimraf.sync(path.join(__dirname, 'node_modules', '.bin')); + fs.rmdirSync(path.join(__dirname, 'node_modules', '.bin'), { recursive: true }); } function processLib() {