简体   繁体   中英

@angular/cli ng serve hangs after some time of working

I've been developing with angular since @angular/cli@5 and ng serve always worked without any problem but recently I updated to 7.0.0 and create a project with angular 7.0.0 and I noticed that after some time of working, angular no longer sees the changes in files. Also refreshing the chrome tab (which the project is served in) will result in infinite spinning.

I thought the problem is with the ~7.0.0 version but when I started working with one of my older projects with version ~6.0.0, the problem existed. I reinstalled @angular/cli@6.2.6 globally but the problem persists.

When this problem happens, pressing ctrl+c will write ^C in terminal but it doesn't stop the ng serve command. Pressing the keys again will result in this output:

^C^C[1] 3080 terminated npm start

And of course the port will be blocked.

I use ubuntu 16.04.

I didn't understand the reason for this problem but found the solution. I noticed that the problem occurs after updating scss files, so I found out this should be a problem with node-sass as there were some changes related to node-sass in angular v7.0.0. running npm i -D node-sass (v4.10.0) solved the problem. Also I think that this issue is related to this problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM