javascript - TypeScript error TS5014: Unexpected token u in JSON at position 0 -
i trying compile .ts .js
i have tsconfig.json
below
{ "compileroptions": { "target": "es5", "module": "commonjs", "sourcemap": true, "outfile": "build/test.js" }, "exclude": [ "node_modules" ] }
below package.json
{ "name": "test", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"error: no test specified\" && exit 1" }, "author": "", "license": "isc", "dependencies": { "tsc": "^1.20150623.0", "typescript": "^2.4.2" } }
and auto generated tasks.json
looks below
{ // see https://go.microsoft.com/fwlink/?linkid=733558 // documentation tasks.json format "version": "2.0.0", "tasks": [ { "type": "typescript", "tsconfig": "tsconfig.json", "problemmatcher": [ "$tsc" ], "group": { "kind": "build", "isdefault": true } } ] }
when try run build task, getting below error
executing task: <myprojloc>\node_modules\.bin\tsc.cmd -p "<myprojloc>\tsconfig.json" < error ts5014: failed parse file '<myprojloc>/tsconfig.json/tsconfig.json': unexpected token u in json @ position 0. terminal reused tasks, press key close it.
what doing wrong? please, note have added versions in package.json
there bunch of things can go wrong when saving file prevent correct parsing. elect not deal renaming file tsconfig.json.backup
or something, invoking tsc --init
generate known file. can transfer specific configuration newly generated tsconfig.json
file, uncommenting parts care about.
if persists after that, actual bug in typescript version you're on.
Comments
Post a Comment