How to change port number in vue-cli project

salman picture salman · Nov 10, 2017 · Viewed 113.9k times · Source

How to change Port number in Vue-cli project so that it run's on another port instead of 8080.

Answer

Nick Litwin picture Nick Litwin · Jul 14, 2018

If you're using vue-cli 3.x, you can simply pass the port to the npm command like so:

npm run serve -- --port 3000

Then visit http://localhost:3000/