vscode live 服务器端口设置不起作用,并且始终在 localhost:8081 中打开

1 port visual-studio-code liveservertestcase

这是我的实时服务器设置 json

{
    "editor.fontSize": 18,
    "workbench.iconTheme": "vscode-icons",
    "files.autoSave": "onFocusChange",
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    "explorer.confirmDelete": false,
    "editor.tabCompletion": "on",
    "editor.tabSize": 2,
    "vetur.format.options.useTabs": true,
    "editor.detectIndentation": false,
    "git.autofetch": false,
    "liveServer.settings.host": "localhost",
    "liveServer.settings.port": 0,

}
Run Code Online (Sandbox Code Playgroud)

我尝试重新安装live Server并关闭Windows防火墙,但仍然不起作用。

这让我发疯!

小智 5

查看您的工作区,在 .vscode/settings.json 中,您可能会在其中找到“liveServer.settings.port”:8081。删除即可