TypeScript error TS5014: Unexpected token u in JSON at position 0

后端 未结 6 852
南方客
南方客 2021-01-07 19:11

I am trying to compile a .ts to .js

I have tsconfig.json as below

{
\"compilerOptions\": {
    \"target\": \"es5\",
    \"module\": \"co         


        
6条回答
  •  情话喂你
    2021-01-07 19:26

    After trying something from this link, I re-write the tasks.json as below and it now worked. Seems the command has some problem previously

    {
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "taskName": "compile",
            "type": "shell",
            "command": "tsc -p tsconfig.json",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": []
        }
    ]
    }
    

提交回复
热议问题