JSON中的角度构建 - 意外的令牌]

时间:2018-03-09 12:09:23

标签: angular tsconfig

花了几个小时的时间经历了无数的npm安装,只是为了找到一个角度&材料兼容的解决方案,我想我可能已经接近终于能够运行我的应用...

但是,在使用 我收到以下错误。这个Tsconfig文件暂时没有改变,所以我不确定问题是什么。

  

错误TS5014:无法在位置329的JSON中解析文件' mylocation / tsconfig.json':意外的令牌。

{
 "compileOnSave": false,
 "compilerOptions": {
  "outDir": "./dist/out-tsc",
  "sourceMap": true,
  "declaration": false,
  "moduleResolution": "node",
  "emitDecoratorMetadata": true,
  "experimentalDecorators": true,
  "allowJs": true,
  "target": "es5",
  "types": [
   "node",
   "hammerjs",
  ],
  "typeRoots": [
   "../node_modules/@types"
  ],
  "lib": [
   "es2017",
   "dom"
  ]
},
 "files": [
  "typings/index.d.ts"
 ]
}

尝试解决这个问题的任何帮助都会很棒。我想我已经失明了一点雪。

1 个答案:

答案 0 :(得分:1)

"hammerjs",

上有额外的逗号
{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowJs": true,
    "target": "es5",
    "types": [
      "node",
      "hammerjs"
    ],
    "typeRoots": [
      "../node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  },
  "files": [
    "typings/index.d.ts"
  ]
}