這裏我嘗試升級我Angular2到Angular4我得到錯誤的嚴重性代碼說明項目文件的線路抑制狀態 錯誤生成:初始值設定不準在周圍環境 包.js打字稿錯誤:初始化器不允許在環境方面
{
"name": "angular-quickstart",
"version": "1.0.0",
"scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings"
},
"license": "ISC",
"dependencies": {
"@angular/common": "4.0.0",
"@angular/compiler": "4.0.0",
"@angular/core": "4.0.0",
"@angular/forms": "4.0.0",
"@angular/http": "4.0.0",
"@angular/platform-browser": "4.0.0",
"@angular/platform-browser-dynamic": "4.0.0",
"@angular/router": "4.0.0",
"@angular/upgrade": "4.0.0",
"core-js": "^2.4.1",
"reflect-metadata": "^0.1.3",
"rxjs": "^5.0.1",
"systemjs": "0.19.27",
"zone.js": "^0.8.4",
"bootstrap": "^3.3.6"
},
"devDependencies": {
"concurrently": "^2.2.0",
"lite-server": "^2.2.2",
"typescript": "^2.0.2",
"typings": "^1.3.2"
}
}
它與'package.json'沒有關係,請將代碼粘貼到出現此錯誤的位置。 – Faisal
儘管拋出錯誤的代碼是理解問題的「必須」,但我不會說package.json與錯誤無關。這可能是一個版本問題。但當然,這可能是別的。 – Pac0