Angular2/Angular-cli:将本地项目更新到 Angular 4 时出现问题
Angular2/Angular-cli: issues updating local project to Angular 4
我正在尝试将 angular-cli/angular 2 项目更新为 Angular 4 我用所有必需的 angular4 模块更新了我的 package.json 并且一切似乎都很顺利直到我 运行 应用程序。当我 运行 应用程序时,出现以下错误:
错误:
无法读取未定义的 属性 "provide"。
我已经尝试了我能想到的一切:我删除了 node_modules 并使用 npm install 重新安装,但仍然出现相同的错误...知道可能出了什么问题 here/what 我可以尝试解决这个问题吗?我正在使用 angular-cli 1.0.0.rc-1
我的package.json:
{
"name": "Retail-Mobile",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/compiler-cli": "^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/platform-server": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"moment": "^2.17.1",
"ng2-toastr": "^4.0.1",
"rxjs": "^5.1.0",
"typescript": "^2.2.1",
"zone.js": "^0.8.5"
},
"devDependencies": {
"@angular/cli": "1.0.0-rc.2",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"bootstrap": "3.3.7",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"jquery": "3.1.1",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0"
}
}
原来问题出在我忘记添加 ;在 ng2-toastr import 语句的末尾......我很惊讶 angular-cli 给了我一个如此模糊的无用错误......
我正在尝试将 angular-cli/angular 2 项目更新为 Angular 4 我用所有必需的 angular4 模块更新了我的 package.json 并且一切似乎都很顺利直到我 运行 应用程序。当我 运行 应用程序时,出现以下错误:
错误:
无法读取未定义的 属性 "provide"。
我已经尝试了我能想到的一切:我删除了 node_modules 并使用 npm install 重新安装,但仍然出现相同的错误...知道可能出了什么问题 here/what 我可以尝试解决这个问题吗?我正在使用 angular-cli 1.0.0.rc-1
我的package.json:
{
"name": "Retail-Mobile",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/compiler-cli": "^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/platform-server": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"moment": "^2.17.1",
"ng2-toastr": "^4.0.1",
"rxjs": "^5.1.0",
"typescript": "^2.2.1",
"zone.js": "^0.8.5"
},
"devDependencies": {
"@angular/cli": "1.0.0-rc.2",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"bootstrap": "3.3.7",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"jquery": "3.1.1",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0"
}
}
原来问题出在我忘记添加 ;在 ng2-toastr import 语句的末尾......我很惊讶 angular-cli 给了我一个如此模糊的无用错误......