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!
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.
Settings
(Ctrl+Comma) . ScreenshotExtensions
, which is located on the left side of the window. ScreenshotLive Server Config
Edit in settings.json
under Settings: Port
. ScreenshotCtrl+s
.liveServer.settings.port: Customize Port Number of your Live Server. If you want random port number, set it as 0.
Follow these steps to change port of Live Server in VS Code:
Step 1 . Open up VS Code.
Step 2. Use Ctrl+Shift+I Shortcut key to open up Extensions (on the left side).
Step 3. Find out the live server extension, then click on the gear icon at the bottom of it, and open up Extension Settings.
Step 4. Here, find out, Live Server > Settings: Port, under this, click on Edit in settings.json.
Step 5. Here, set the port on which you wanna open up live server (set value to 0 for random ports).
Step 6. Now, click ctrl+s to save the file.
After this, you can test it by opening any file using live server.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.