Angular-cli: ng serve hangs at 70%

Created on 16 Dec 2016  路  23Comments  路  Source: angular/angular-cli

Please provide us with the following information:

OS?

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

Windows 10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
$ ng --version angular-cli: local (v1.0.0-beta.23, branch: master) node: 6.9.2 os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

It was working fine in beta-21.
Latest version results in this error. I desperately need this version as I need the i18n features.

The log given by the failure.

Normally this include a stack trace and some more information.

$ ng serve ** NG Live Development Server is running on http://localhost:4200. ** 70% building modules 1290/1290 modules 0 active

Mention any other details that might be useful.

Another issue ( https://github.com/angular/angular-cli/issues/3508 ) with this problem was marked as duplicate of ( https://github.com/angular/angular-cli/issues/3368 ). That's not right. In my case, in beta-21 the application compiles fine in AOT. So, as since beta-22 AOT is enabled by default, it should also still work. So it may be an AOT issue, but by making AOT no longer default, this issue won't be fixed.

I am starting to lose confidence in Angular CLI. I am aware it's work in progress, but in every commit I get random errors. I've tried most of the commits since i18n was introduced, and every one gives a different error.
And the fact that .beta-22 introduced a major bug (AOT enabled by default) doesn't help either.
You're doing a great job, but keep in mind that people use this tool for production websites.

Most helpful comment

+1

EDIT: Apparently it has something to do with yarn, when I do rm -rf node_modules && npm install, ng serve works as intended, but yarn install breaks it. Somewhere a version gets screwed I guess.

ANOTHER EDIT:

NPM warn with 1.0.0beta.22-1 package.json:

npm WARN [email protected] requires a peer of tslint@^3.0.0 but none was installed.

Yarn warnings:

warning Incorrect peer dependency "@angular/compiler@~2.3.1".
warning Incorrect peer dependency "@angular/compiler-cli@~2.3.1".
warning Incorrect peer dependency "@angular/core@~2.3.1".
warning Unmet peer dependency "@angular/tsc-wrapped@~0.5.0".

All 23 comments

same here,

TEMPORARY WORKAROUND
downgrading to @ngtools/webpack 1.1.9 solved this. By downgrading I mean you add @ngtools/webpack as dependency to your package.json

In my case downgrading to tslint 4.0.2 solved the problem.

@antonybudianto7 and @schroedan ... didn't work for me :/

@donotfold have you cleaned your node_modules before re-installing?

Have the same issue.
I deleted node_modules
I linked angular-cli in my project to use the latest beta.23
And put @ngtools/webpack 1.1.9 in my package.json
Run npm install
Run ng init to re-initiate my project.

But ng serve stucks on 70%

btw I used beta.22-1, not beta.23, sorry forgot to mention it.

I have the same issue with beta.22-1

Having the same issue with beta.21. Tried rm -rf node_modules to no avail.

+1

EDIT: Apparently it has something to do with yarn, when I do rm -rf node_modules && npm install, ng serve works as intended, but yarn install breaks it. Somewhere a version gets screwed I guess.

ANOTHER EDIT:

NPM warn with 1.0.0beta.22-1 package.json:

npm WARN [email protected] requires a peer of tslint@^3.0.0 but none was installed.

Yarn warnings:

warning Incorrect peer dependency "@angular/compiler@~2.3.1".
warning Incorrect peer dependency "@angular/compiler-cli@~2.3.1".
warning Incorrect peer dependency "@angular/core@~2.3.1".
warning Unmet peer dependency "@angular/tsc-wrapped@~0.5.0".

@nikoTM It definitely has something to do with yarn; after rm -rf node_modules && npm install, I had to upgrade "@angular/compiler" and "@angular/core" from 2.0.0 to 2.2.3 in my package.json. Then, I had lots of warnings from npm but finally got ng serve to work. ;)

Right. The process now terminates instead. I just submitted a PR for a better error message and, in the case of watching (serve or build --watch), stay in process and watch file changes.

Fresh install of angular-cli@latest(1.0.0-beta.22-1) and ng serve is hanging on 70%

@Kosmonaft I've raised this issue on the master branch. So either revert to beta.21, or clone the repository and run from there.
I've confirmed that the bug has been resolved in master branch.

I got it compiling by changing the codelyzer to version 2, but I'm not sure this was the culprit.

angular 2.2.3
angular-cli beta 22-1

"codelyzer": "2.0.0-beta.1",

I think it's related with how yarn is resolving the dependencies. It looks like it's installing versions that have NOT been published on npm such us version 1.2.0 of @ngtools/webpack instead of the last published version (1.1.9) and the same thing happens with codelyzer

@ngtools/package in npm displaying 1.1.9 is the latest of 13 releases

@rolandoldengarm I clone the repository and now I'm getting this error:
notarget No compatible version found: [email protected]

My current version:
fatal: Not a git repository (or any of the parent directories): .git angular-cli: local (v1.0.0-beta.23, branch: ??) node: 6.9.1 os: win32 x64

  1. Clone the repository into a folder
  2. Go to that folder and run "npm link"
  3. Go to your Angular 2 project, and run "npm link angular-cli"

Just as documented here: https://github.com/angular/angular-cli#development-hints-for-hacking-on-angular-cli
@Kosmonaft

I had the same issue after updating to [email protected], @[email protected], and [email protected]. I got around the 70% build hang by downgrading to [email protected] and installing [email protected] as a dev dependency.

Workaround:

  1. ng build
  2. ng server

For me in this way is working

I had this issue when I tried to use cli with angular 2. Then I switched to angular-webpack-starter which worked fine. Now Im trying to upgrade my app to angular 5 I have this issue again. It just freezes on 76% forever without any errors or something on how I can fix this issue. When I configure my app from scratch using angular 5 and systemjs - it works fine.

@Kosmonaft Thank you!!!! This issue took me nearly 16 hours to figure out. Needless to say, I tried nearly everything to resolve the issue, however, to no avail, nothing worked.

ng build
ng server

is all it took. Also, below are some of my versions:

Angular CLI: 1.7.4
Node: 6.9.2
OS: win32 x64
Angular: 5.2.11
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.7.4
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.4.2
webpack: 3.12.0

Another thing I should mention is that I had to downgrade the ngx-spinner module from the latest version to version 6.0.0.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings