你好,我已經研究過這個問題,並已經實施了兩個解決方案,爲其他人工作,但我仍然得到相同的錯誤。我正通過本教程在這裏:解析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