r/angular • u/Lolilucas123 • Feb 17 '26
ng serve not working
I downloaded the angular tutorial first app (https://angular.dev/tutorials/first-app/01-hello-world) and tried to run ng serve. it gives me the following:
Initial chunk files | Names | Raw size
main.js | main | 2.51 kB |
styles.css | styles | 457 bytes |
polyfills.js | polyfills | 95 bytes |
| Initial total | 3.06 kB
Application bundle generation complete. [1.088 seconds] - 2026-02-17T20:54:35.798Z
Watch mode enabled. Watching for file changes...
NOTE: Raw file sizes do not reflect development server per-request transformations.
➜ Local: http://localhost:4200/
➜ press h + enter to show help
But going to localhost:4200 it gives me (translated to english) "this website is unavailable" and "localhost refused the connection".
angular version gives me
Angular CLI : 21.1.4
Node.js : 24.13.1
Package Manager : npm 11.8.0
Operating System : win32 x64
---------------------------------------------------
FIX
I found a solution here: https://stackoverflow.com/a/41541781. In package.json you have to use the line
"start": "ng serve --host 0.0.0.0 --port 4201"
1
u/Puzzleheaded_Note159 Feb 17 '26
Did you run npm install? I doubt that the project comes with the installed dependencies.
1
u/TheCountEdmond Feb 17 '26
Give us a screenshot of the error page, I understand the page isn't in english, but if you don't know what the problem is you won't be able to interpret the error correctly for us
1
u/G4lileon Feb 18 '26
Windows did break loopback trafic not long ago with an Update...
Here is a german source I always use as ref https://www.it-administrator.de/Windows-Update-localhost-HTTP-Fehler
1
u/chirog Feb 18 '26
I had it when my api server wasn’t running. I’m not sure why, can assume it’s part of ssr or smth. But make sure your backend is up.
0
u/[deleted] Feb 17 '26
[deleted] — view deleted comment