Search code examples
visual-studio-codeport-numberliveservertestcase

Where to set value of liveServer.settings.port in live server extension of visual studio code


I am working on Angular7 with visual studio code editor URL: http://localhost:4200 (Working fine)

But, I installed extension Live Server and when I click on Liveserver icon its giving me the error

"Error on port 5500. Please try to change the port through settings or report on GitHub."

So, I opened the File->preference->Settings->LiveServerConfig and tried to change port in settings.json file

{
    "typescript.tsdk": "./node_modules/typescript/lib",
    "tslint.enable": false,
    "liveServer.settings.multiRootWorkspaceName": "QiwkCollaboratorTool",
    "liveServer.settings.root": 0  // New added line
}

Am I going into right direction or am I missing something ? I am not sure how to change the port number 5500 to 0 as I want random port number.

Thanks in advance!


Solution

  • I got the answer I was editing the wrong settings.json there were two .json files.

    enter image description here

    Also, I put the below code:

    {
        "liveServer.settings.multiRootWorkspaceName": "",
        "liveServer.settings.port": 0
    }
    

    But thanks Danny