question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng serve error localhost could NOT be bound

See original GitHub issue

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Mac OSX El Capitan

Versions.

Please run ng --version. If there’s nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.16 node: 4.6.0 os: darwin x64

Repro steps.

Was this an app that wasn’t created using the CLI? What change did you do on your code? etc. A lot of changes but the backend guy can work with cli and use ng serve

The log given by the failure.

Normally this include a stack trace and some more information.

ng serve

Provided host localhost could NOT be bound. Please provide a different host address or hostname Error: Provided host localhost could NOT be bound. Please provide a different host address or hostname at Error (native) at /usr/local/lib/node_modules/angular-cli/node_modules/portfinder/lib/portfinder.js:139:27 at /usr/local/lib/node_modules/angular-cli/node_modules/portfinder/node_modules/async/lib/async.js:52:16 at /usr/local/lib/node_modules/angular-cli/node_modules/portfinder/node_modules/async/lib/async.js:264:21 at /usr/local/lib/node_modules/angular-cli/node_modules/portfinder/node_modules/async/lib/async.js:44:16 at /usr/local/lib/node_modules/angular-cli/node_modules/portfinder/lib/portfinder.js:117:16 at Server.onError (/usr/local/lib/node_modules/angular-cli/node_modules/portfinder/lib/portfinder.js:54:14) at Server.g (events.js:260:16) at emitOne (events.js:77:13) at Server.emit (events.js:169:7) at emitErrorNT (net.js:1269:8) at nextTickCallbackWith2Args (node.js:442:9) at process._tickCallback (node.js:356:17)

Mention any other details that might be useful.


Thanks for your help

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
filipesilvacommented, Oct 10, 2016

It seems like there is some problem binding to localhost. Can you try ng serve --host 0.0.0.0 instead?

6reactions
doronsevercommented, Nov 23, 2017

If someone still phasing this(mac os), you need to edit /etc/hosts and make sure you have this line: 127.0.0.1 localhost

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng serve error localhost could NOT be bound - Stack Overflow
I am new in angular 5, I am try to run angular 5 project get following error "ng serve error localhost could NOT...
Read more >
How to run angular cli on ec2 instance ng serve not working
Solution for error. Provided host xx.xx.xx.xx could NOT be bound. ... If you are getting this error with localhost:4200 you can try ng...
Read more >
Getting started with service workers - Angular
To set up the Angular service worker in your project, use the CLI command ng add @angular/pwa . It takes care of configuring...
Read more >
Errors | ngrok documentation
Try starting ngrok with the full upstream service URL (e.g. ngrok http https://localhost:8081). ERR_NGROK_3200, Tunnel not found. This could ...
Read more >
How to allow access outside localhost in AngularJS
If you are still not able to access 192.168.X.X:4200, you may be in a network where firewall protection is ON. Disable the protection...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found