0

I am using the Visual Studio Code to work with TypeScript. I created the tasks.json file in order to compile the ts files, but I getting this error when I run it:

/bin/sh: tsc: command not found
The terminal process terminated with exit code: 127

This is my tasks.json file:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "type": "typescript",
            "tsconfig": "tsconfig.json",
            "problemMatcher": [
                "$tsc"
            ]
        }
    ]
}

Does anyone know what is this? I am using Linux Mint.

It is not duplicated one of tsc is not recognized as internal or external command I already tried those steps but it did not worked.

This is my tsconfig.json:

{
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "sourceMap": true
    }
}

Using the terminal when I type node -v it is showing this: v11.2.0

tsc -v: Version 3.1.6

Edmar Munhoz
  • 221
  • 1
  • 4
  • 12
  • 2
    Possible duplicate of [tsc is not recognized as internal or external command](https://stackoverflow.com/questions/35369501/tsc-is-not-recognized-as-internal-or-external-command) – tink Nov 16 '18 at 17:33
  • Hi tink, No, it is not duplicated. – Edmar Munhoz Nov 16 '18 at 17:37
  • From the cited duplicate, you are lacking `.vscode/tasks.json` in `tasks.json` (among other things). Until you provide accurate information, like the exact configuration and exact error message, your question appears to be a duplicate. – jww Nov 16 '18 at 18:56
  • I added more information, do you think you need more information? – Edmar Munhoz Nov 16 '18 at 19:29

1 Answers1

1

It appears that the binary tsc is not in your path. Have the package(s) for TypeScript been installed? This is probably a duplicate of tsc is not recognized as internal or external command

jamie
  • 84
  • 6
  • Hi jamie, Thanks, but if you realize the version is different, if you see the file content I pasted here there is no command parameter. Anyway, I tried what you suggested and it did not worked. – Edmar Munhoz Nov 16 '18 at 17:35
  • @EdmarMunhoz has typescript been installed via npm, though? If it was installed locally instead of globally, it is possible that the location of the binary might not be in your path. as suggested in the other post, you should try to run `npm install -g typescript` to install it globally. – jamie Nov 16 '18 at 17:48
  • Then you should try some of the other suggestions on the other post. Yes the "command" key or whatever isn't currently in your file, but you can add it. This is almost certainly a duplicate of what they discussed on that other post. – jamie Nov 16 '18 at 17:57