Search code examples
javascriptvue.jsvuejs2vue-cli-3

Serve Vue Cli 3.10.0 Project in a specific port


How can I serve Vue CLI project in a specific port always, say 8888? I tried the following options.

  1. Editing the serve script in package.json to vue-cli-service serve --port 8888
  2. Updating the devServer option in vue.config.js. I modified the same to

    devServer: { port: 8888 }

  3. Serving project specifying port option in serve command like npm run serve -- --port 8888

None of the above mentioned steps brought me a luck. Can I know how this to be done in the right way?


Solution

  • Try to update your version latest 3.11.0

    Here is the screenshot

    enter image description here

    I hope it will work for you now