I have create an angular project via
ng new project_name --style=scss
and then try to run via
ng serve
but getting error
removed and reinstalled the node_modules
but all in vain.
Every time getting this error, please guide what to do!!!
UPDATE 1
Why I am not able to run Angular
application on localhost
(running on 192.168.X.X:4200) in my office pc but the same project I can run on localhost
at my home
UPDATE 2
in hosts file, I have this. Is it OK?
127.0.0.1 localhost
::1 localhost
Update 3
I am quite sure, it is only the system config issue that's why it is blocking localhost and allowing 192.168.X.X but don't know where the problem lies.
Just put your
favicon.ico
file to your project root directory and update yourfavicon
file inject code with the below code in thehead
of yourindex.html
file. ThanksThere is no Angular CLI command such as npm start, Did you mean that?
Please check this out, https://angular.io/cli/serve
You can use the following method to solve the same :
Check your LAN proxy settings.
In chrome Settings -> Advanced -> Open Proxy Settings -> LAN Settings -> make sure you unchecked "use proxy server for your LAN" or mark "bypass proxy server for local address" if you are using proxy
Also if the above settings didn't solve your problem probably the port
4200
is already used in the system try running app on a different portng serve --port 4401
Also make sure you clear browser cache to see the result
I was using
Opera
browser for testing and it was my default browser and trying to accesslocalhost:4200
but every timeconnection refused
then I test this onChrome
, it ran smoothly.I checked proxy setting for both the browsers and there was no proxy enabled. Finally I reset data in
Opera
and problem resolved.Still, question is there!!! What was that hindering
localhost
...Put your favicon.ico file in assets folder and change the path in the index.html