From 197e1331ff53f01633e18f1a61bc0b3328e76b94 Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Mon, 15 Mar 2021 08:46:07 -0700 Subject: [PATCH] fix typescript require --- packages/core/src/auto.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/src/auto.ts b/packages/core/src/auto.ts index cfc8d32bd..5f5802230 100644 --- a/packages/core/src/auto.ts +++ b/packages/core/src/auto.ts @@ -74,8 +74,12 @@ import { execSync } from "child_process"; import isBinary from "./utils/is-binary"; import { gitReset } from "./utils/git-reset"; -if (require.resolve("typescript")) { - require("ts-node/register/transpile-only"); +try { + if (require.resolve("typescript")) { + require("ts-node/register/transpile-only"); + } +} catch (error) { + // User doesn't have TS installed, cannot write TS plugins } const proxyUrl = process.env.https_proxy || process.env.http_proxy;