角度 – 在ng服务上获取错误:错误无法读取未定义的属性“listLazyRoutes”

前端之家收集整理的这篇文章主要介绍了角度 – 在ng服务上获取错误:错误无法读取未定义的属性“listLazyRoutes”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当在命令行中为角度生成的项目运行时,我在下面得到错误
ERROR in Cannot read property 'listLazyRoutes' of undefined

关于如何解决这个错误的任何想法?

将angle-cli更新为最新:npm install -g angular-cli @最新版本

在我特定的情况下,我将package.json更新为:

"dependencies": {
    "@angular/common": "^2.4.0","@angular/compiler": "^2.4.0","@angular/core": "^2.4.0","@angular/forms": "^2.4.0","@angular/http": "^2.4.0","@angular/platform-browser": "^2.4.0","@angular/platform-browser-dynamic": "^2.4.0","@angular/router": "~3.4.0","core-js": "^2.4.1","rxjs": "^5.0.1","ts-helpers": "^1.1.1","zone.js": "^0.7.2"
  },"devDependencies": {
    "@angular/compiler-cli": "^2.3.1","@types/jasmine": "2.5.38","@types/node": "^6.0.42","angular-cli": "1.0.0-beta.24","codelyzer": "~2.0.0-beta.1","jasmine-core": "2.5.2","jasmine-spec-reporter": "2.5.0","karma": "1.2.0","karma-chrome-launcher": "^2.0.0","karma-cli": "^1.0.1","karma-jasmine": "^1.0.2","karma-remap-istanbul": "^0.2.1","protractor": "4.0.13","ts-node": "1.2.1","tslint": "^4.0.2","typescript": "~2.0.3","webdriver-manager": "10.2.5"
  }

执行npm安装与这个package.json内容,它将工作.

原文链接:https://www.f2er.com/angularjs/143088.html

猜你在找的Angularjs相关文章