Autocompile is not working in angular project while making some chanages

I am running an angular project.

 

While I made some changes i need to run ng s again and again..

in my other machine while I made some changes its auto-compile and refresh the browser  with the recent changes.

0
13 comments

do you mean that project re-building is not triggered once you change your code and hit Ctrl+S? Or, code is re-built, but browser is not refreshed? Might be an issue with hanndling safe writes... Please try turning 'Safe write' option ( Settings | Appearance & Behavior | System Settings | Use "safe write" (save changes to temporary file first)) off - does it make any difference?

see also  https://github.com/angular/angular-cli/issues/1610 for some hints

0
Avatar
Permanently deleted user

Yes. the project re-building is not triggered once I changed the code and hit Ctrl+S. 

Also I turn off the Safe Write before only..

0

Strange... Are you using the ng serve command? Does re-building work when you edit and save files outside of the IDE?

0
Avatar
Permanently deleted user

Yes I am using ng serve. No once the server started the re-building is not working for the new changes.. even for the simple alert also..

For that again I need to stop the server Ctrl+C and then again I start the server using ng serve.

 

Do I need to use webpack for that??

0

ng serve uses webpack internally... What OS are you on, what cli version is used? Do you have white spaces/non-ASCII characters in your project path?

0
Avatar
Permanently deleted user

UBUNTU 16.04 LTS

Angular CLI: 6.1.3

No, white spaces/non-ASCII characters..  it was working before.. suddenly it stops for me.. The same projects is working fine in other machine. we are three people working on the same project..we are sharing same repository.. its not working for me.. every time i need to stop and re run again ng serve for every small changes..

0
Avatar
Permanently deleted user

Hello Elena Pogorelova,

I have an update, may be you will get some idea. 

 

Once I install npm i webpack the re-building is working..

But the thing is that we don't want to install extra package, since it is working in other machine with out installing this package..

So, could you help me now ??

0

projects created with angular cli do have webpack installed (i believe, cli 6.1.3 bundles webpack @4.9.2)... May be the issue with this particular webpack version (works fine for me though)... No good ideas, sorry. I'd suggest reporting the issue to https://github.com/angular/angular-cli/issues

 

BTW, you can also check if increasing the amount of inotify watchers makes things any better

0
Avatar
Permanently deleted user

I faced the same problem. But when I run the ng serve command with a sudo, auto compilation started working. 

It's a bit surprising. I do not understand why but I don't care as long as it works! But I would be happier if someone could explain why.

1
Avatar
Permanently deleted user

Thank you Santosh,

sudo ng serve is working for me also

1
Avatar
Permanently deleted user

sudo ng serve is NOT working for me.

it shows me : sudo: ng: command not found

0

Looks like ng is not on your $PATH

0
Avatar
Permanently deleted user
I would kiss you if you were here you big beutiful genius. Thank you so much!
sudo ng serve is working
0

Please sign in to leave a comment.