Skip to content

Cli --port option reports "something is already running on port ${number}"  #3505

@arinthros

Description

@arinthros

🐛 Bug Report

When running the command npm run serve -- --port 3000, the system reports Something is already running on port 3000. The same behavior is exhibited for any port, both in local and CI environments. When running just npm run serve it boots up on port 3000 with no issues.

I have tested and confirmed this issue exists on a vanilla Docusaurus 2 installation.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. npx @docusaurus/init@next init docusaurus-repro classic
  2. cd docusaurus-repro
  3. npm run build
  4. npm run serve -- --port 3000 (or any port)

Expected behavior

npm run serve -- --port 3000 should boot the app on port 3000.

Actual Behavior

npm run serve -- --port 3000 gives the notice Something is already running on port 3000. When selecting no to run on another port, the app boots into http://localhost:null.

Screen Shot 2020-09-30 at 11 00 03 AM

Your Environment

  • Docusaurus version used: 2.0.0-alpha.64
  • Environment name and version: Node LTS (12.18.4)
  • Operating system and version: MacOS 10.15.6
  • CI environment: node:lts docker image

Reproducible Demo

https://github.com/arinthros/docusaurus-repro
See To Reproduce

Activity

added
bugAn error in the Docusaurus core causing instability or issues with its execution
status: needs triageThis issue has not been triaged by maintainers
on Sep 30, 2020
added
good first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.
help wantedAsking for outside help and/or contributions to this particular issue or PR.
and removed
status: needs triageThis issue has not been triaged by maintainers
on Oct 1, 2020
slorber

slorber commented on Oct 1, 2020

@slorber
Collaborator

thanks, looks like a good first issue for hacktoberfest :)

added a commit that references this issue on Oct 1, 2020
2351ca1
UmairKamran

UmairKamran commented on Oct 2, 2020

@UmairKamran
Contributor

Hi, @slorber. First timer here. May I take this issue for hacktoberfest?

slorber

slorber commented on Oct 2, 2020

@slorber
Collaborator

Hi @UmairKamran and welcome.

Yes please give it a try and also read comments on #3514 :)

UmairKamran

UmairKamran commented on Oct 3, 2020

@UmairKamran
Contributor

Hey @slorber and @arinthros, I've opened the PR #3531 to fix this issue. Hope you get the chance to review it soon. :)

linked a pull request that will close this issuefix(v2): Fixes serve cli --port option #3531on Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executiongood first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.hacktoberfesthelp wantedAsking for outside help and/or contributions to this particular issue or PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @slorber@arinthros@UmairKamran

      Issue actions

        Cli --port option reports "something is already running on port ${number}" · Issue #3505 · facebook/docusaurus