Something is already running on port 3000

后端 未结 7 1507
遥遥无期
遥遥无期 2021-01-16 09:29

I have tried to run my project on my localhost but it is saying Something is already running on your port 3000.

相关标签:
7条回答
  • 2021-01-16 09:39

    After all the googled advices failed to solve the problem of why already working project started failing:

    First running: npm install

    then running: npm start worked for me.

    0 讨论(0)
  • 2021-01-16 09:40

    You can run this Command npx kill-port 3000 . This command keeps empty your 3000 port

    0 讨论(0)
  • 2021-01-16 09:44

    Launch Task Manager, find all the programs/tasks that are related Nodejs and stop them.

    0 讨论(0)
  • 2021-01-16 09:49

    I know this is late , but if anyone faces the same issue might want to try this

    sudo kill -9 $(sudo lsof -t -i:9001)
    

    where, 9001 is your port number.

    0 讨论(0)
  • 2021-01-16 09:50

     

    On React - you can run an already created React single-page application (SPA) by

    npm start command.

    That may start your locally hosting development server and runs your app at:

    http://localhost:3000/ which is equivalent to: 127.0.0.1:3000 address

    127.0.0.1 is the default localhost IP number while the default port number set by

    create-react-app package is 3000.

    When getting: “Something is already running on port 3000" failure error message you may think that the port captured by another process running on your machine but you’ll find that it is captured permanently as if it runs on 0.0.0.0:3000 address

    Solution:

    In your project libraries created by create-react-app script navigate to:

    node_modules/react-scripts/scripts/start.js

    While running npm start command - the start.js script is being called and executed

    There at start.js file in you editor find the above line:

    const HOST = process.env.HOST || '0.0.0.0';

     and change it to:

    const HOST = process.env.HOST || '127.0.0.1';

     

    save and run your web app again at: http://localhost:3000/ or http://127.0.0.1:3000

     

     

     

    0 讨论(0)
  • 2021-01-16 09:54

    If you're using Linux, you can run the following commands on your console:

    fuser -n tcp 3000
    

    The command above will return the task ID of the program that is currently using the port. Then you will have to run

    kill -9 [#task]
    

    with the task ID. (Just replace all the '[#task]' by the task ID returned)

    0 讨论(0)
提交回复
热议问题