Skip to content

TypeError: ts.parseConfigFile is not a function #1703

@moonman239

Description

@moonman239

Search Terms

parseConfigFile

Expected Behavior

ts-node runs with an REPL

Actual Behavior

Error message:

return ts.parseConfigFile(config, ts.sys, fileName);
^

TypeError: ts.parseConfigFile is not a function
at readConfig (C:\Users\moonman239\AppData\Roaming\npm\node_modules\typescript-node\dist\typescript-node.js:31:15)
at Object.register (C:\Users\moonman239\AppData\Roaming\npm\node_modules\typescript-node\dist\typescript-node.js:43:18)
at Object. (C:\Users\moonman239\AppData\Roaming\npm\node_modules\typescript-node\dist\bin\ts-node.js:34:33)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (C:\Users\moonman239\AppData\Roaming\npm\node_modules\typescript-node\bin.js:3:1)

Steps to reproduce the problem

Not sure of the exact steps to reproduce other than to follow the guide on a Windows machine:

  1. install typescript
  2. install ts-node
  3. install that configuration thing
  4. Run "ts-node" in the command line

It may be that I also have ES6 modules and Jest, and that I've configured my project to use these tools.

Minimal reproduction

N/A

Specifications

  • ts-node version: latest version available via "npm install"
  • node version: 16.14.2
  • TypeScript version: cannot obtain from above command due to above error; TSC version 4.3.5
  • tsconfig.json, if you're using one:
{
  "compilerOptions": {
    "module": "esnext",
    "target": "ESNext",
    "lib": ["ESNext"],
    "resolveJsonModule": true,
    "moduleResolution": "node"
  },
  "ts-node": {
    "compilerOptions": {
      "module": "esnext",
      "target": "ES2019"
    }
  }
}
  • Operating system and version:
  • If Windows, are you using WSL or WSL2?:

Windows 11, no WSL or WSL2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    user errorIssues that were ultimately human error, not a bug nor a missing feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions