简体   繁体   English

Visual Studio Code 上的 404 Live Server 错误

[英]404 Live Server Error on Visual Studio Code

I installed Live Server extension by Ritwick Dey on VS Code, but when I load it live.我在 VS Code 上安装了 Ritwick Dey 的 Live Server 扩展,但是当我实时加载它时。 it shows the following error:它显示以下错误:

Object not found!未找到对象! The requested URL was not found on this server.在此服务器上找不到请求的 URL。 If you entered the URL manually please check your spelling and try again.如果您手动输入了 URL,请检查您的拼写并重试。

If you think this is a server error, please contact the webmaster.如果您认为这是服务器错误,请联系网站管理员。

Error 404 127.0.0.1 Apache/2.4.34 (Win32) OpenSSL/1.1.0i PHP/7.2.10错误 404 127.0.0.1 Apache/2.4.34 (Win32) OpenSSL/1.1.0i PHP/7.2.10

looks like it can't find the path, previously it was working fine.看起来它找不到路径,以前它工作正常。 Please help me fix it.请帮我修复它。 Thanks谢谢

edit: If I deactivate xampp this error shows, don't know if it has to do anything with it, but hope this helps:编辑:如果我停用 xampp 此错误显示,不知道它是否必须对它做任何事情,但希望这会有所帮助:

Error: connect ECONNREFUSED 127.0.0.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1161:14)错误:在 TCPConnectWrap.afterConnect [as oncomplete] 连接 ECONNREFUSED 127.0.0.1:80 (net.js:1161:14)

I have met the same problem when I used the live sever to browse my index.html page, but I fixed that finally.当我使用实时服务器浏览我的 index.html 页面时,我遇到了同样的问题,但我最终解决了这个问题。 It turns out that I have open one folder in the vscode, and I just pull the new index.html into the vscode and check it, but this index.html file is not in the folder that I just turn on in the vscode, so when I run the live server to preview the web page I got the 404Not Find warning, so I turn off the original folder and open the folder that the index.html file in it, I run it again and I successfully got the web page I wanted to see.原来我在vscode中打开了一个文件夹,我只是把新的index.html拉入vscode中查看,但是这个index.html文件不在我刚在vscode中打开的文件夹中,所以当我运行实时服务器预览网页时,我收到了 404Not Find 警告,所以我关闭了原始文件夹并打开其中包含 index.html 文件的文件夹,我再次运行它并成功获取了我的网页想看看。

If you're using XAMPP server you should put your files inside htdocs folder, usually located to c:\\xampp\\htdocs . 如果您使用的是XAMPP服务器,则应将文件放在htdocs文件夹中,该文件夹通常位于c:\\xampp\\htdocs Server is running, the problem is it cannot found files because it's trying to access to the wrong folder. 服务器正在运行,问题在于它找不到文件,因为它正在尝试访问错误的文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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