Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An unhandled exception occurred: listen EACCES: permission denied 127.0.0.1:8080 #87

Open
shylendramadda opened this issue Aug 23, 2020 · 16 comments

Comments

@shylendramadda
Copy link

After doing npm install when I run ng serve I am getting this error:

An unhandled exception occurred: listen EACCES: permission denied 127.0.0.1:8080

unable to run the project.

@swiftone
Copy link
Contributor

EACCESS is a permission from the local system - Usually I see this if I'm running another server (or another instance of the same server) on the same port (8080 in this case).

Unfortunately, how to check your system to see what is already bound to a port will vary depending on your OS, and is a bit outside the scope of the sample docs.

@mraible
Copy link
Contributor

mraible commented Aug 24, 2020

You can install fkill-cli to kill processes running on a certain port.

npm i -g fkill-cli
fkill :8080

@aarongranick-okta
Copy link
Contributor

You can probably use the --port cli option to serve on a different port. However, you would also need to adjust your login redirect URI to use the same port. https://angular.io/cli/serve

@shylendramadda
Copy link
Author

Okay, thanks @swiftone let me check this and let you know.

@shylendramadda
Copy link
Author

shylendramadda commented Aug 25, 2020

@swiftone Now I stopped my server which is running on the same port 8080. Now I found this error:
An unhandled exception occurred: Environment variable ISSUER must be set. See README.md See "C:\Users\myPC\AppData\Local\Temp\ng-LwessF\angular-errors.log" for further details.

I already set the ISSUER and CLIENT_ID in the environment.ts

export const environment = {
  production: false,
  ISSUER: 'https://myoktadomain.com/oauth2/default',
  CLIENT_ID: '0oasgasdhdjhgasjdbgj' // it's a dummy one
};

@shylendramadda
Copy link
Author

You can install fkill-cli to kill processes running on a certain port.

npm i -g fkill-cli
fkill :8080

I tried this here is the log
fkill :8080

? Error killing process. Would you like to use the force? Yes
AggregateError:
    Error: Killing process :8080 failed: Process doesn't exist
        at Array.map (<anonymous>)
        at fkill (C:/Users/shyle/AppData/Roaming/npm/node_modules/fkill-cli/node_modules/fkill/index.js:128:9)
        at async Object.handleFkillError (C:/Users/shyle/AppData/Roaming/npm/node_modules/fkill-cli/interactive.js:125:4)      
    at fkill (C:\Users\shyle\AppData\Roaming\npm\node_modules\fkill-cli\node_modules\fkill\index.js:128:9)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.handleFkillError (C:\Users\shyle\AppData\Roaming\npm\node_modules\fkill-cli\interactive.js:125:4)

@suresh444
Copy link

You can install fkill-cli to kill processes running on a certain port.

npm i -g fkill-cli
fkill :8080

I tried this here is the log
fkill :8080

? Error killing process. Would you like to use the force? Yes
AggregateError:
    Error: Killing process :8080 failed: Process doesn't exist
        at Array.map (<anonymous>)
        at fkill (C:/Users/shyle/AppData/Roaming/npm/node_modules/fkill-cli/node_modules/fkill/index.js:128:9)
        at async Object.handleFkillError (C:/Users/shyle/AppData/Roaming/npm/node_modules/fkill-cli/interactive.js:125:4)      
    at fkill (C:\Users\shyle\AppData\Roaming\npm\node_modules\fkill-cli\node_modules\fkill\index.js:128:9)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.handleFkillError (C:\Users\shyle\AppData\Roaming\npm\node_modules\fkill-cli\interactive.js:125:4)

After doing npm install when I run ng serve I am getting this error:

An unhandled exception occurred: listen EACCES: permission denied 127.0.0.1:8080

unable to run the project.

how did you resolve this??

@TKaluthanthri
Copy link

I had the same issue I solved this by restarting the Windows NAT

open CMD/PowerShell and type net stop winnat and then net start winnat

@francodevarg
Copy link

Well, Google bring me here. I got the same issue with Vue3 by running.
npm run dev

I Solved this by adding a flag '--port 3001' (Which means : use another port by default)

npm run dev --port 3001

Maybe this issue is due that other app is using the same port.
Hope you solve it! 😃 👍

@ChichebeDarlington
Copy link

please help me out still getting same error after trying all the possible solutuon listed here.

Error: listen EACCES: permission denied 8000;

@SaurabhBose
Copy link

SaurabhBose commented Nov 29, 2022

For anyone coming here in future: I would suggest use command prompt (as admin) and
net stop winnat
net start winnat
This should free up the ports.

@Ibinola
Copy link

Ibinola commented Feb 8, 2023

thanks @SaurabhBose it worked for me!

@Karanpal97
Copy link

tried every thing which is mentioned above, not working plz help me to get out of this

@IasmimCristina
Copy link

Me too! T_T

@SaurabhBose
Copy link

If my earlier solution of

net stop winnat
net start winnat

did not work:

  1. Are you running the cmd as admin? If not, Right-click on the application or command prompt you're using to start the server and select "Run as administrator".
  2. netstat -ano | findstr :8080 : and try stopping processes binding on that port.

@dumindu-dev
Copy link

On Windows System, restarting the service "Host Network Service", resolved the issue.

Original answer: https://stackoverflow.com/a/65434145/12731030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests