本文介绍了浏览器未通过 BrowserSync 或实时服务器启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 live-server 和 VS Code 来调试一些网页.一切都很好,我从页面目录中的命令行运行了 live-server,Chrome 打开了一个包含该页面的新标签页.

I've been using live-server with VS Code to debug some web pages. Everything was fine, I ran live-server from my command line in the page directory and Chrome opened a new tab with the page.

然后突然停止工作!我觉得这有点奇怪,所以我再次安装了 Nodejs,之后出现了一个问题.服务器正在工作,但无法打开 Chrome(或任何其他浏览器)

Then suddenly it stopped working! I though it was a bit weird so I installed Nodejs again and an issue appeared afterwards. The server is working but it isn't able to open Chrome (nor any other Browser)

我尝试使用 BrowserSync 而不是 live-server,再次,服务器可以工作,但无法自动打开 Chrome

I tried using BrowserSync instead of live-server and again, the server works but it isn't able to automatically open Chrome

我总是可以手动输入 http://localhost:3000 但我不应该(因为它以前工作过)

I can always manually type http://localhost:3000 but I shouldn't (since it worked before)

我已经尝试卸载和安装 live-server 和 browserSync、Chrome.刷新我的 dns,检查恶意软件,检查 Windows 防火墙是否阻止了任何相关的事情,以及其他一些没有为我做任何事情的事情,我仍然得到:

I've tried uninstalling and installing both live-server and browserSync, Chrome.Flushing my dns, checking for malware, checking if Windows Firewall is blocking anything related, and some other things that hadn't done anything for me, I still get the:

无法打开浏览器(如果您在无头环境中使用 BrowserSync,您可能需要设置打开选项为false)

此处

有人可以告诉我是什么导致了这个问题,或者我应该如何尝试解决它?

Can someone please tell me what could be causing this issue or how should I attempt to fix it?

推荐答案

出现问题是因为不知何故 C:\Windows\System32 不在系统路径变量中.我刚刚重新添加了它,重新启动计算机,它再次正常工作

The problem occurred because somehow C:\Windows\System32 was not in the System Path Variable. I just added it again, restarted the computer and it works fine again

这篇关于浏览器未通过 BrowserSync 或实时服务器启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 08:52