vscode-auto-run-command icon indicating copy to clipboard operation
vscode-auto-run-command copied to clipboard

Condition met but command [tsc --watch] raised an error - [Error: command 'tsc' not found]

Open PaloMraz opened this issue 7 years ago • 2 comments

I tried to start the TypeScript compiler in watch mode:

"auto-run-command.rules": [
    {
      "condition": "always",
      "command": "tsc --watch",
      "message": "Starting TypeScript compiler in watch mode..."
    }
  ]

But the tool gives me "[Auto Run Command] Condition met but command [tsc --watch] raised an error - [Error: command 'tsc' not found] ". Running "tsc --watch" from the Terminal window works fine...

My VSCode version is as follows:

Version: 1.27.1 (user setup)
Commit: 5944e81f3c46a3938a82c701f96d7a59b074cfdc
Date: 2018-09-06T09:21:18.328Z
Electron: 2.0.7
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

PaloMraz avatar Sep 14 '18 12:09 PaloMraz

I figured out that so-called "command" in this extension is not "shell commands", but "VSCode command". Check in this issue: https://github.com/Microsoft/vscode-docs/issues/683

So maybe you can configurate a vscode task and configurate this extention like this:

"auto-run-command.rules": [
    {
      "condition": "always",
      "command": "workbench.action.tasks.runTask YOUR_TASK_NAME",
      "message": "Starting TypeScript compiler in watch mode..."
    }
  ]

~~I don't know whether this is a best solution, but at least it works for me.~~ Now I turned to Blade Runner

ylc395 avatar Oct 19 '18 08:10 ylc395

what is the task name for tsc: watch? doesn't seem like something we've defined...

xenoterracide avatar Feb 26 '20 22:02 xenoterracide