have a new project but when ng serve i get error

旧时模样 提交于 2019-12-02 20:42:30
Maniac_1979

I would recommend reading this:

https://www.techiediaries.com/updating-angular-cli-projects/

On this page it states:

Angular 6 uses angular.json instead of angular-cli.json. This can be achieved using :

ng update @angular/cli

This solved my issue.

Good luck

Angular 6 looks for angular.json instead of angular-cli.json.

You need to update your @angular/cli. Adding to the above answer

I did update all the package with the following commands and updated all dependencies too. So as to remove all compatibility issues with other packages.

If you are starting your app or demo app, follow this procedure. Be extra careful if you are doing this for production app.

npm install -g npm-check-updates
ncu -u
ng update @angular/cli
npm install

Install npm-check-updates

npm install -g npm-check-updates 

Use ncu to update your package.json

ncu for display

ncu -u for re-writing your package.json

Update your @angular/cli to modify your application to be compatible with angular 6

ng update @angular/cli 

and run npm install to update your packages

Re-Install @angular/cli

npm install @angular/cli

Just use the official upgrade guide which will tell you what you need to do for your own particular needs:

https://update.angular.io/

That seems to be caused by different version of angular-cli is installed. I just created a new project, using new command, then copied across the src directory. then compiled them all successfully.

    ng new UX7

In my case I just needed to close/reopen my terminal after I had remove/reclone a repo. Not sure what happened there.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!