Skip to content

Commit

Permalink
only ts-node/register for plugins if typescript is installed to the p…
Browse files Browse the repository at this point in the history
…roject
  • Loading branch information
hipstersmoothie committed Mar 14, 2021
1 parent 47ea37f commit be5c068
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/auto.ts
Expand Up @@ -74,7 +74,9 @@ import { execSync } from "child_process";
import isBinary from "./utils/is-binary";
import { gitReset } from "./utils/git-reset";

import "ts-node/register/transpile-only";
if (require.resolve("typescript")) {
require("ts-node/register/transpile-only");
}

const proxyUrl = process.env.https_proxy || process.env.http_proxy;
const env = envCi();
Expand Down

1 comment on commit be5c068

@reckter
Copy link
Contributor

@reckter reckter commented on be5c068 Mar 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this causes problems in CI environments with npx auto commands.
We get (in github actions):

npx: installed 228 in 10.695s
Cannot find module 'typescript'
Require stack:
- /home/runner/.npm/_npx/1535/lib/node_modules/auto/node_modules/@auto-it/core/dist/auto.js
- /home/runner/.npm/_npx/1535/lib/node_modules/auto/dist/parse-args.js
- /home/runner/.npm/_npx/1535/lib/node_modules/auto/dist/bin/auto.js

running the command npx auto check-pr

Edit: Ticket: #1880

Please sign in to comment.