你好,我已经研究过这个问题,并已经实施了两个解决方案,为其他人工作,但我仍然得到相同的错误。我正通过本教程在这里:解析angular-cli.json失败。在位置0的语法错误
https://devblog.dymel.pl/2016/10/25/angular2-cli-with-aspnet-core-application-tutorial/
但是在前端目录中运行NPM开始,当我收到读
解析角cli.json失败的错误。请让你的angular-cli.json有效。 SyntaxError:意外的令牌?通过建设有角CLI一个新的项目,粘贴来自新项目的角cli.json文件,而更改名称
Parsing angular-cli.json failed
:在位置0
我已经试过这里的解决方案和OutDir。然后我去了工具 - 选项 - 文本编辑器 - 一般 - 并且未选中“AutoDetect UTF 8 encoding without signature”。
但是我仍然得到相同的错误。这真令人沮丧。
角cli.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "MYPROJ"
},
"apps": [
{
"root": "src",
"outDir": "../Backend/wwwroot",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"component": {}
}
}
我已经得到这个当VS它使用UTF-BOM-8编码的设置后启动。如果你有记事本+ + +,尝试在那里打开它,并在编码菜单中设置它只是普通的UTF-8 – Steveadoo
@Steveadoo好吧即时将现在尝试它。一会儿...... – RyeGuy
不幸的是它没有工作。还有其他建议吗? – RyeGuy