微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Lite-server VSCode:本地主机拒绝连接错误

如何解决Lite-server VSCode:本地主机拒绝连接错误

我正在使用 WSL2 运行我的 VSCode,并使用 lite-server 在 Microsoft Edge 上运行我的 html 代码。昨天一切正常,但今天当我使用 lite-server 运行我的代码时,出现错误:Localhost 拒绝连接。我什至不明白问题出在哪里,因为我从昨天开始就没有对我的代码或设置进行任何更改。

当我运行我的代码时,我的终端会显示这个:

    > lite-server

Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults...
** browser-sync config **
{
  injectChanges: false,files: [ './**/*.{html,htm,css,js}' ],watchOptions: { ignored: 'node_modules' },server: { baseDir: './',middleware: [ [Function],[Function] ] }
}
[browsersync] Access URLs:
 --------------------------------------
       Local: http://localhost:3000
    External: http://172.26.135.30:3000
 --------------------------------------
          UI: http://localhost:3001
 UI External: http://localhost:3001
 --------------------------------------
[browsersync] Serving files from: ./
[browsersync] Watching files...

像昨天一样,终端应该像这样运行:

> lite-server

Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults...
** browser-sync config **
{ injectChanges: false,[Function] ] } }
[BS] Access URLs:
 --------------------------------------
       Local: http://localhost:3000
    External: http://10.40.244.189:3000
 --------------------------------------
          UI: http://localhost:3001
 UI External: http://10.40.244.189:3001
 --------------------------------------
[BS] Serving files from: ./
[BS] Watching files...
16.12.21 18:43:32 200 GET /index.html
16.12.21 18:43:32 200 GET /style.css
16.12.21 18:43:33 200 GET /app2.js

有谁知道如何解决我的问题?提前致谢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。