Skip to content

Commit 1009bd8

Browse files
committed
fix: avoid using TS_NODE_COMPILER env
1 parent 3029e64 commit 1009bd8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/server/lib/plugins/child/ts_node.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ const semver = require('semver')
88
const debug = debugLib('cypress:server:ts-node')
99

1010
const getTsNodeOptions = (tsPath, registeredFile) => {
11-
const compiler = process.env.TS_NODE_COMPILER || tsPath
12-
13-
const version = require(compiler).version
11+
const version = require(tsPath).version || '0.0.0'
1412

1513
/**
1614
* NOTE: This circumvents a limitation of ts-node
@@ -36,7 +34,7 @@ const getTsNodeOptions = (tsPath, registeredFile) => {
3634
* @type {import('ts-node').RegisterOptions}
3735
*/
3836
const opts = {
39-
compiler, // use the user's installed typescript
37+
compiler: process.env.TS_NODE_COMPILER || tsPath, // use the user's installed typescript
4038
compilerOptions,
4139
// resolves tsconfig.json starting from the plugins directory
4240
// instead of the cwd (the project root)

0 commit comments

Comments
 (0)