vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

Port 5000 is taken on MacOS Monterey

Open politician opened this issue 3 years ago • 4 comments

Describe the bug

Port 5000 which is used by default by vitepress serve is already taken by system processes on MacOS Monterey.

Reproduction

Run vitepress serve in MacOS Monterey

Expected behavior

Serve the vitepress website

System Info

System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Max
    Memory: 499.31 MB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.volta/tools/image/node/16.14.2/bin/node
    Yarn: 1.22.17 - ~/.volta/tools/image/yarn/1.22.17/bin/yarn
    npm: 8.5.0 - ~/.volta/tools/image/node/16.14.2/bin/npm
  Browsers:
    Chrome: 102.0.5005.61
    Firefox: 100.0.2
    Firefox Developer Edition: 97.0
    Safari: 15.5

Additional context

No response

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

politician avatar Jun 04 '22 08:06 politician

Run it like this:

vitepress serve docs --port 8080

We currently don't attempt serving on next available port because many people are using vitepress serve to host their sites, if the port is auto-incremented then there might be certain issues due to the port not being fixed. Hence, we leave this to our users to explicitly specify the port to serve on.

brc-dd avatar Jun 04 '22 09:06 brc-dd

We currently don't attempt serving on next available port because many people are using vitepress serve to host their sites, if the port is auto-incremented then there might be certain issues due to the port not being fixed. Hence, we leave this to our users to explicitly specify the port to serve on.

Ok this totally makes sense.

politician avatar Jun 04 '22 09:06 politician

@brc-dd So why not change a new constant port instead?

JounQin avatar Jun 21 '22 10:06 JounQin

Vite is using 4173 for preview feature so maybe we could align with it 👀

kiaking avatar Jun 21 '22 10:06 kiaking