angular-cli: ng serve command not working
Please provide us with the following information:
OS?
MacOS Sierra
Versions.
angular-cli: 1.0.0-beta.28.3 node: 7.4.0 os: darwin x64
Repro Steps
After running ‘ng serve’ in an app created by ‘ng new…’ I get this output from the console:
`As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release,
which will only support Node 6.9 and greater. This package will be officially deprecated
shortly after.
To disable this warning use "ng set --global warnings.packageDeprecation=false".
** NG Live Development Server is running on http://localhost:4200. **
Hash: b17a9b8b2eeffaf40894 e Time: 6294ms
chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 222 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.map (main) 3.94 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.map (styles) 10 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.64 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.`
But when I navigate to the localhost:4200 in my browser, I get this message:
This site can’t be reached
localhost refused to connect.
Which to me indicates that there is nothing running on that port, contrary to what the output in the console says. If I try running in different ports, I get the same result. No error messages, just no server.
Any help would be really appreciated.
Thanks! We’ll be in touch soon.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 37 (5 by maintainers)
Commits related to this issue
- Updated AngularCLI for windows Angular CLI was breaking. Updated with https://github.com/angular/angular-cli/issues/4368 — committed to matthewharwood/morningharwood-client by matthewharwood 7 years ago
for any of you guys who still have the problem, you need to re-install angular-cli through this command
npm install -g @angular/cli
or if you are using the old cli, you can just updated by this command
ng update
I had some different but equally weird problems with
ng serve
last night. OS?Windows 10
Versions. angular-cli: @latest node: 7.4.0
I would run ng serve. The bundle would work properly. Onchange of the code, webpack would recompile successfully. Refresh browser and the changes were not represented at all.
I also updated to 1.0.0-beta.28.3, I created completely new app
ng new something
and thanng serve
, and this is happening:@denkomanceski I have the exact same problem
@kilgarenone a new version of
@ngtools/webpack
has been released recently.Can you remove
node_modules
andnpm install
and see if that fixes it?In Issue #1610 webpack live reload is not working, miguelcaravantes commented 5 hours ago:
This worked for me.
I’m also experiencing the same issue as @denkomanceski
I’m having the same issue. Apparently I choose the wrong time to get into Angular dev again ☹️
Same issues here, also noticed changes are not reflected when using
ng build -watch
. Not sure if this issue is related https://github.com/angular/angular-cli/issues/4353@matthewharwood That’s interesting. I have the opposite issue. I just updated to 1.0.0-beta.28.3 and right now if I run ng serve, I get a ‘… is not an NgModule’ error. If i change something and it reloads I don’t get any errors and it serves fine.