How to kill VueJS application running on localhost:8080 (MacOS)

Kevin Patrick

My environment: MacOS Mojave

I created a VueJS application from their templates using

vue init pwa frontend
? Project name frontend
? Project short name: fewer than 12 characters to not be truncated on homescreens (default: same as name)
? Project description A Vue.js project
? Author [email protected]
? Vue build runtime
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Setup unit tests with Karma + Mocha? No
? Setup e2e tests with Nightwatch? No

yarn
yarn dev

That worked fine. The page ran on localhost:8080 and closed when ctrl-c.

I then built it for production

yarn build

I wrote a quick JS server to launch the contents from the dist/ folder to see what it looks like after building it.

const ora = require('ora')
const chalk = require('chalk');
const express = require('express');
const port = process.env.PORT || 8080;
const app = express();
const spinner = ora(chalk.yellow("Your application is starting..."));
spinner.start();

var delay = ( function() {
    var timer = 0;
    return function(callback, ms) {
        clearTimeout (timer);
        timer = setTimeout(callback, ms);
    };
})();

app.use(express.static(__dirname + "/dist/"));
app.get(/.*/, function(req, res) {
    res.sendFile(__dirname + "/dist/index.html");
});

app.listen(port);

delay(function() {
    app.use(express.static(__dirname + "/dist/"));
    app.get(/.*/, function(req, res) {
        res.sendFile(__dirname + "/dist/index.html");
    });
}, 3000);

spinner.stop();
console.log(chalk.cyan("Your application is running here: ") + ("http://localhost:8080"));

I run the server node server.js

However when I ctrl-c it kills the script however the application is still running on localhost:8080

I have tried sudo lsof -i tcp:8080 and netstat -vanp tcp | grep 8080 and they both returned nothing. Which leaves me with the following question: How do I stop this from listening on port 8080?

Kevin Patrick

If anyone was wondering, I found out the problem. I had to go to chrome://serviceworker-internals and chrome://appcache-internals. I did a search for localhost:8080 and killed those serviceworkers.

I hope this helps whoever this happens to next!

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to kill a localhost:8080

分類Dev

server running on localhost:8080 getting CORS from frontend running on 9090

分類Dev

localhost:8080(MacOS)で実行されているVueJSアプリケーションを強制終了する方法

分類Dev

How to redirect rest requests from localhost:8080 to different port?

分類Dev

How configure react app to start in localhost 8080 in spring boot backend

分類Dev

How to kill a running process using ansible?

分類Dev

How can I fully kill a program and/or python code running on Windows?

分類Dev

Check if process is running and kill it

分類Dev

http://localhost:8080/ vs http://server_IP_address:8080/

分類Dev

http:// localhost:8080 / vs http:// server_IP_address:8080 /

分類Dev

localhost 4848、8080の問題

分類Dev

How do I view the Meteor app running on the VM at localhost:3000?

分類Dev

Unable to kill processes running concurrently

分類Dev

Error in SLURM cluster - Detected 1 oom-kill event(s): how to improve running jobs

分類Dev

Run iOS application on macOS

分類Dev

How to kill a runaway cat?

分類Dev

Windows 10 Kill EDB Postgres8080サーバー

分類Dev

Vuejs + webpack - build for production but deploy to localhost

分類Dev

How to run my Angular site on mobile device that is running localhost on my windows desktop

分類Dev

How to run my Angular site on mobile device that is running localhost on my windows desktop

分類Dev

Linux Fedora - how to create DSN of database in MySQL instance running on localhost for use by RODBC?

分類Dev

how to access Apache server running on host os using the name other than the ip address or localhost on vmware guest

分類Dev

Node Server Running on Ubuntu that needs to execute a C# application - how?

分類Dev

Is it possible to bundle Perl with a macOS application?

分類Dev

Wildflyがlocalhost:8080 / appをlocalhost:8080 / app /にリダイレクトし続け、403エラーで終了する

分類Dev

Application Express on Ubuntu Server refused to connect port 8080

分類Dev

How to change default port 8080 in WildFly

分類Dev

How to kill a process on a port on ubuntu

分類Dev

How to kill dead cursors in MongoDB

Related 関連記事

  1. 1

    How to kill a localhost:8080

  2. 2

    server running on localhost:8080 getting CORS from frontend running on 9090

  3. 3

    localhost:8080(MacOS)で実行されているVueJSアプリケーションを強制終了する方法

  4. 4

    How to redirect rest requests from localhost:8080 to different port?

  5. 5

    How configure react app to start in localhost 8080 in spring boot backend

  6. 6

    How to kill a running process using ansible?

  7. 7

    How can I fully kill a program and/or python code running on Windows?

  8. 8

    Check if process is running and kill it

  9. 9

    http://localhost:8080/ vs http://server_IP_address:8080/

  10. 10

    http:// localhost:8080 / vs http:// server_IP_address:8080 /

  11. 11

    localhost 4848、8080の問題

  12. 12

    How do I view the Meteor app running on the VM at localhost:3000?

  13. 13

    Unable to kill processes running concurrently

  14. 14

    Error in SLURM cluster - Detected 1 oom-kill event(s): how to improve running jobs

  15. 15

    Run iOS application on macOS

  16. 16

    How to kill a runaway cat?

  17. 17

    Windows 10 Kill EDB Postgres8080サーバー

  18. 18

    Vuejs + webpack - build for production but deploy to localhost

  19. 19

    How to run my Angular site on mobile device that is running localhost on my windows desktop

  20. 20

    How to run my Angular site on mobile device that is running localhost on my windows desktop

  21. 21

    Linux Fedora - how to create DSN of database in MySQL instance running on localhost for use by RODBC?

  22. 22

    how to access Apache server running on host os using the name other than the ip address or localhost on vmware guest

  23. 23

    Node Server Running on Ubuntu that needs to execute a C# application - how?

  24. 24

    Is it possible to bundle Perl with a macOS application?

  25. 25

    Wildflyがlocalhost:8080 / appをlocalhost:8080 / app /にリダイレクトし続け、403エラーで終了する

  26. 26

    Application Express on Ubuntu Server refused to connect port 8080

  27. 27

    How to change default port 8080 in WildFly

  28. 28

    How to kill a process on a port on ubuntu

  29. 29

    How to kill dead cursors in MongoDB

ホットタグ

アーカイブ