2017-07-19 14 views
7

मुझे यह त्रुटि मिल रही है।त्रुटि टीएस 5014: फाइल '' को पार्स करने में असफ़ल: JSON में अप्रत्याशित टोकन आपको स्थिति 0 पर टर्मिनल प्रक्रिया से बाहर निकलने वाली टर्मिनल प्रक्रिया: 1

error TS5014: Failed to parse file '/Users/Documents/tsconfig.json/tsconfig.json': Unexpected token u in JSON at position 0. 
The terminal process terminated with exit code: 1 

मेरे प्रणाली सेटअप:

  1. दृश्य स्टूडियो कोड संस्करण 1.14.1
  2. कोणीय 2
  3. नोड संस्करण v8.0.0
  4. tsc संस्करण 2.4.1

package.json निम्नानुसार है

{ 
    "name": "angular-quickstart", 
    "version": "1.0.0", 
    "description": "QuickStart package.json from the documentation, supplemented with testing support", 
    "scripts": { 
    "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ", 
    "e2e": "tsc && concurrently \"http-server -s\" \"protractor protractor.config.js\" --kill-others --success first", 
    "lint": "tslint ./app/**/*.ts -t verbose", 
    "lite": "lite-server", 
    "pree2e": "webdriver-manager update", 
    "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"", 
    "test-once": "tsc && karma start karma.conf.js --single-run", 
    "tsc": "tsc", 
    "tsc:w": "tsc -w" 
    }, 
    "keywords": [], 
    "author": "", 
    "license": "MIT", 
    "dependencies": { 
    "@angular/common": "^2.4.10", 
    "@angular/compiler": "^2.4.10", 
    "@angular/core": "^2.4.10", 
    "@angular/forms": "^2.4.10", 
    "@angular/http": "^2.4.10", 
    "@angular/platform-browser": "^2.4.10", 
    "@angular/platform-browser-dynamic": "^2.4.10", 
    "@angular/router": "^3.4.10", 
    "angular-in-memory-web-api": "^0.2.5", 
    "core-js": "^2.4.1", 
    "rxjs": "^5.4.2", 
    "systemjs": "^0.19.47", 
    "zone.js": "^0.7.8" 
    }, 
    "devDependencies": { 
    "@types/jasmine": "^2.5.41", 
    "@types/node": "^6.0.46", 
    "canonical-path": "0.0.2", 
    "concurrently": "^3.5.0", 
    "http-server": "^0.9.0", 
    "jasmine-core": "~2.4.1", 
    "karma": "^1.3.0", 
    "karma-chrome-launcher": "^2.0.0", 
    "karma-cli": "^1.0.1", 
    "karma-jasmine": "^1.0.2", 
    "karma-jasmine-html-reporter": "^0.2.2", 
    "lite-server": "^2.3.0", 
    "lodash": "^4.16.4", 
    "protractor": "~4.0.14", 
    "rimraf": "^2.5.4", 
    "tslint": "^3.15.1", 
    "typescript": "2.1.6" 
    }, 
    "repository": {} 
} 

tsconfig.json रूप

{ 
    "compilerOptions": { 
    "target": "es5", 
    "module": "commonjs", 
    "moduleResolution": "node", 
    "sourceMap": true, 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "lib": [ "es2015", "dom" ], 
    "noImplicitAny": true, 
    "suppressImplicitAnyIndexErrors": true, 
    "outDir": "dist" 
    } 
} 

उत्तर

0

इस प्रकार आप अपनी tasks.json को कैसे परिभाषित किया है? जब मैंने डिफ़ॉल्ट टाइपस्क्रिप्ट प्रकार के साथ अपना tasks.json परिभाषित किया तो मुझे एक ही समस्या का सामना करना पड़ा। Tasks.json में दिए गए परिवर्तनों के बाद link

{ 
// 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": [] 
    } 
] 
} 
में उत्तर के आधार पर मेरे लिए काम किया
संबंधित मुद्दे