0

On Windows 10, I have installed live-server under node.js with npm install live-server -g in the cmd terminal window on VSCODE. When I start it, with a simple live-server command, it starts but always selects its default port number of 8080. I have other servers running from time to time that use the very common port 8080. How would I start live-server with a different port, say 5501 for example? If this is possible, is there a way to make the simple live-server startup command always default to this new port?

Also, once it is running, how to I properly shut it down?

Richard P
  • 21
  • 5

1 Answers1

1

You can set a manual port like this

const liveServer = require("live-server");
 
const params = { port: 8181 }

liveServer.start(params);

You can find all the params available here.

Shivam
  • 3,514
  • 2
  • 13
  • 27