Getting error on ng serve: ERROR in Cannot read property 'listLazyRoutes' of undefined

前端 未结 3 456
迷失自我
迷失自我 2020-12-30 05:24

When running ng serve in command-line for an angular-cli generated project, I am getting error below:

 ERROR in Cannot read property \'listLazy         


        
3条回答
  •  青春惊慌失措
    2020-12-30 05:56

    I was able to fix the issue by upgrading the angular-cli generated project to angular-cli: 1.0.0-beta.24. If you generated the project from previous version (eg. *-beta.22 in my case), upgrade the local project package(dev dependencies) by running commands below:

    >rm -rf node_modules dist tmp
    >npm install --save-dev angular-cli@latest
    >npm install
    >ng init
    

    To upgrade to new angular-cli, run commands below in the command-line:

    >npm uninstall -g angular-cli
    >npm cache clean
    >npm install -g angular-cli@latest
    

    Update on 2/23/2017: Syntax changed in getting latest angular-cli. Use command below instead:

    npm install --save-dev @angular/cli@latest

提交回复
热议问题