我正在使用 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,
files: [ './**/*.{html,htm,css,js}' ],
watchOptions: { ignored: 'node_modules' },
server: { baseDir: './', middleware: [ [Function], [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
有谁知道如何解决我的问题?提前致谢。