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!
In Solution Explorer, right-click the name of the web application and select Properties. Click the Web tab. In the Servers section, under dropdown selection for IIS Express, change the port number in the Project URL box. To the right of the Project URL box, click Create Virtual Directory, and then click OK.
I got the answer I was editing the wrong settings.json there were two .json files.
Also, I put the below code:
{
"liveServer.settings.multiRootWorkspaceName": "",
"liveServer.settings.port": 0
}
But thanks Danny
I hope this helps: in the settings.json add the following line.
"liveServer.settings.port": 0,
A value 0 (zero) is used for a random port. Any other numbers is for a fixed port number.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With