Solve the problem that the default port number of the vscode plug-in Live Server cannot be modified

If you feel that the default port number 5500 of the Live Server plug-in does not meet your requirements and want to modify the port number, then you may encounter a little trouble:

First of all, whether it is troublesome depends on whether you want to judge whether your Live Server port is the default:

Run an html file casually first, and pay attention to the number in the lower right corner. If it is 5500, it is likely to be the default and it is easy to modify.
picture

First find the Live Server plug-in in your extension => extension settings
picture
. After you find this, click in and you can change it to what you want. After re-running the html file, you can see that the modification is successful.
picture
insert image description here

But if you find that you have indeed modified it, but the original port number is still the same when you run it again, or worse, it is not 5500 at the beginning, it may be 5501, 5502, etc.,It means that your workspace has set the port number separately, and it will read this separately set port number first, so the modification will not take effect, how to modify it?

First of all, you should first check if there is a .vscode folder in your workspace. After clicking on it, there will be a setting.json file. That’s right, it’s OK to click in and modify it;
picture

If you say that your workspace does not have this file, This is also the situation I encountered, this is easy to say, click on Settings => click Tab in the workspace => modify the port number.
picture
picture
picture
picture
Done! ! !

Guess you like

Origin blog.csdn.net/weixin_46166330/article/details/127611856
Recommended