Angular-cli SyntaxError:意外的令牌]

时间:2017-03-24 17:50:44

标签: json angular angular-cli

我刚用git拉出了我的项目的新版本,而angular-cli停止了工作。当我启动它时,我收到以下错误:

Parsing .angular-cli.json failed. Please make sure your .angular-cli.json is valid JSON. Error:
SyntaxError: Unexpected token ] in JSON at position 1044
InvalidConfigError: Parsing .angular-cli.json failed. Please make sure your .angular-cli.json is valid JSON. Error:
SyntaxError: Unexpected token ] in JSON at position 1044

我的angular-cli.json文件如下:

{
    "project": {
        "version": "1.0.0-beta.22-1",
        "name": "quest"
    },
    "apps": [
        {
            "root": "src",
            "outDir": "dist",
            "assets": [
                "assets"
            ],
            "index": "index.html",
            "main": "main.ts",
            "test": "test.ts",
            "tsconfig": "tsconfig.json",
            "prefix": "app",
            "mobile": false,
            "styles": [
                "styles.less",
                "../node_modules/angular2-toaster/toaster.css",
                "../node_modules/bootstrap-slider/dist/css/bootstrap-slider.min.css",
                "../node_modules/bootstrap-timepicker/css/bootstrap-timepicker.css",
                "../node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.css"
            ],
            "scripts": [
                "../node_modules/jquery/dist/jquery.js",
                "../node_modules/bootstrap/dist/js/bootstrap.js",
                "../node_modules/admin-lte/dist/js/app.js",
                "../node_modules/bootstrap-slider/dist/bootstrap-slider.js",
                "../node_modules/bootstrap-timepicker/js/bootstrap-timepicker.min.js",
                "../node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"
            ],
            "environmentSource": "environments/environment.ts",
            "environments": {
                "dev": "environments/environment.ts",
                "prod": "environments/environment.prod.ts"
            }
        }
    ],
    "addons": [],
    "packages": [],
    "e2e": {
        "protractor": {
            "config": "./protractor.conf.js"
        }
    },
    "test": {
        "karma": {
            "config": "./karma.conf.js"
        }
    },
    "defaults": {
        "styleExt": "css",
        "prefixInterfaces": false,
        "inline": {
            "style": false,
            "template": false
        },
        "spec": {
            "class": false,
            "component": true,
            "directive": true,
            "module": false,
            "pipe": true,
            "service": true
        }
    }
}

我尝试更新angular-cli,我尝试删除node_modules并运行npm install。我有节点版本6.9.5。我尝试使用一些JSON验证工具解析angular-cli.json

还有其他想法吗?

0 个答案:

没有答案