连接被拒绝:localhost:4200 favicon.ico 502 in angular 7 [英] Connection refused: localhost:4200 favicon.ico 502 in angular 7

查看:70
本文介绍了连接被拒绝:localhost:4200 favicon.ico 502 in angular 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过

ng new project_name --style=scss

然后尝试通过

ng serve

但出现错误

删除并重新安装了node_modules,但都是徒劳的.

removed and reinstalled the node_modules but all in vain.

每次出现这个错误,请指导怎么办!!!

Every time getting this error, please guide what to do!!!

更新 1

为什么我无法在办公室电脑上的 localhost(在 192.168.XX:4200 上运行)上运行 Angular 应用程序,但我可以在 localhost 上运行相同的项目code>localhost 在我家

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

更新 2

在主机文件中,我有这个.可以吗?

in hosts file, I have this. Is it OK?

127.0.0.1 本地主机

127.0.0.1 localhost

::1 本地主机

更新 3

我很确定,这只是系统配置问题,这就是为什么它阻止本地主机并允许 192.168.X.X 但不知道问题出在哪里.

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.

推荐答案

我使用 Opera 浏览器进行测试,它是我的默认浏览器并试图访问 localhost:4200 但是每次连接被拒绝然后我在Chrome上测试它,它运行顺利.

I was using Opera browser for testing and it was my default browser and trying to access localhost:4200 but every time connection refused then I test this on Chrome, it ran smoothly.

我检查了两个浏览器的代理设置,但没有启用代理.最后,我在 Opera 中重置了设置和数据并解决了问题.

I checked proxy setting for both the browsers and there was no proxy enabled. Finally I reset settings and data in Opera and problem resolved.

仍然有问题!!!是什么阻碍了 localhost ...

Still, question is there!!! What was that hindering localhost ...

这篇关于连接被拒绝:localhost:4200 favicon.ico 502 in angular 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆