当我升级到Angular 4并运行ng服务时,我收到以下错误:
ERROR in Cannot read property 'getSymbolByModule' of undefined
依赖关系按照以下
使用 "dependencies": {
"@angular/animations": "^4.0.2",
"@angular/cli": "^1.0.0",
"@angular/common": "^4.0.2",
"@angular/compiler": "^4.0.2",
"@angular/compiler-cli": "^2.4.10",
"@angular/core": "^4.0.2",
"@angular/forms": "^4.0.2",
"@angular/http": "^4.0.2",
"@angular/platform-browser": "^4.0.2",
"@angular/platform-browser-dynamic": "^4.0.2",
"@angular/platform-server": "^4.0.2",
"@angular/router": "^4.0.2",
"@types/jasmine": "^2.5.47",
"angular2-flash-messages": "^1.0.8",
"angular2-jwt": "^0.1.28",
"codelyzer": "^2.1.1",
"core-js": "^2.4.1",
"jasmine-spec-reporter": "^2.7.0",
"karma": "^1.6.0",
"rxjs": "^5.3.0",
"ts-helpers": "^1.1.2",
"ts-node": "^1.7.3",
"typescript": "^2.0.10",
"zone.js": "^0.8.5"
},
这里有什么问题吗?
答案 0 :(得分:21)
您还需要将@ angular / compiler-cli更新到版本4。
"@angular/compiler-cli": "4.0.2",
答案 1 :(得分:1)
这似乎是与@angular/platform-browser
相关的问题。
您的@angular/platform-browser
和@angular/cli
版本之间存在冲突。尝试将您的angular / cli更新为最新版本。讨论了同样的问题here
答案 2 :(得分:0)
我遇到了同样的问题,但我的devDependencies
中也有一个版本的angular-cli。我删除了它,ng-serve工作了。