1👍
This error happens when the port is already in use. You can solve this with two options.
-
Kill the port
- Check if the port is already in use using this command
lsof -i :80
- Kill the port using the
PID
that will be provided if the port was in use usingkill {{PID}}
-
Run the project on a different port
You can actually run your vue app on a different port
- Using Npm ->
npm run serve --port 8080
- Using Yarn ->
yarn serve --port 8080
0👍
As your machine gets started, it will need to know the mapping of some hostnames to IP addresses before DNS can be referenced. This mapping is kept in the /etc/hosts file. In the absence of a name server, any network program on your system consults this file to determine the IP address that corresponds to a host name.
127.0.0.1 localhost
127.0.0.1 yourdomain.com
Then you can run npm run dev --host yourdomain.com
with custom host/port using vue-cli.
Also you can change the devServer in vue.config.js
Source:stackexchange.com