1
votes

I'm using Angular 5.0.0. And I want to connect angular-bootstrap-md. But when you start the application ng s an error occurs.

error TS5014: Failed to parse file 'C:/Users/Admin/Desktop/angular/tsconfig.json': Unexpected token } in JSON at position 437.

Error: error TS5014: Failed to parse file 'C:/Users/Admin/Desktop/angular/tsconfig.json': Unexpected token } in JSON at position 437. at AngularCompilerPlugin._setupOptions (C:\Users\Admin\Desktop\angular\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:90:19) at new AngularCompilerPlugin (C:\Users\Admin\Desktop\angular\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:43:14) at _createAotPlugin (C:\Users\Admin\Desktop\angular\node_modules\@angular\cli\models\webpack-configs\typescript.js:77:16) at Object.getNonAotConfig (C:\Users\Admin\Desktop\angular\node_modules\@angular\cli\models\webpack-configs\typescript.js:100:19) at NgCliWebpackConfig.buildConfig (C:\Users\Admin\Desktop\angular\node_modules\@angular\cli\models\webpack-config.js:37:37) at Class.run (C:\Users\Admin\Desktop\angular\node_modules\@angular\cli\tasks\serve.js:71:98) at check_port_1.checkPort.then.port (C:\Users\Admin\Desktop\angular\node_modules\@angular\cli\commands\serve.js:123:26) at process._tickCallback (internal/process/next_tick.js:68:7)

The first bracket stands out in red I can not understand why it seems all the brackets are closed

tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  },
  "include": ["node_modules/angular-bootstrap-md/**/*.ts", "src/**/*.ts"],
}
3

3 Answers

3
votes

Just remove the erroneous comma at the end in order to achieve a valid JSON file:

{
    "compileOnSave": false,
    "compilerOptions": {
        "outDir": "./dist/out-tsc",
        "sourceMap": true,
        "declaration": false,
        "moduleResolution": "node",
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "target": "es5",
        "typeRoots": [
            "node_modules/@types"
        ],
        "lib": [
            "es2017",
            "dom"
        ]
    },
    "include": ["node_modules/angular-bootstrap-md/**/*.ts", "src/**/*.ts"]
}

In case of doubt, you can check the validity using one of various tools, e.g. JSONLint.

2
votes

{
	"compileOnSave": false,
	"compilerOptions": {
		"outDir": "./dist/out-tsc",
		"sourceMap": true,
		"declaration": false,
		"moduleResolution": "node",
		"emitDecoratorMetadata": true,
		"experimentalDecorators": true,
		"target": "es5",
		"typeRoots": [
			"node_modules/@types"
		],
		"lib": [
			"es2017",
			"dom"
		]
	},
	"include": ["node_modules/angular-bootstrap-md/**/*.ts", "src/**/*.ts"]
}
0
votes

Remove comma at the end of this line:

"include": ["node_modules/angular-bootstrap-md/**/*.ts", "src/**/*.ts"],