Skip to content

How can i debug typescript with ts-node? #659

Answered by buddhiko1
buddhiko1 asked this question in Q&A
Discussion options

You must be logged in to vote

After a long time of trying, it finally works.
You can debug typescript file directly with ts-node.

This is my configuration:

  -- set console for pure typescript program (e.g. cli program).
  dap.defaults.fallback.external_terminal = {
    command = "/usr/bin/alacritty",
    args = { "-e" },
  }
  dap.defaults.fallback.force_external_terminal = true
  dap.defaults.fallback.terminal_win_cmd = "50vsplit new"
  dap.defaults.fallback.focus_terminal = true
  dap.set_log_level("INFO")

-- depending on your installation location.
local debugger_location = os.getenv("HOME") .. "/Software/vscode-node-debug2"

dap.adapters.node = {
    type = "executable",
    command = "node",
    args = { debugg…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@minhtranin
Comment options

@buddhiko1
Comment options

Answer selected by buddhiko1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants