angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.76k stars 11.98k forks source link

Ng build stuck at 11% 13/13 modules - node maxing out CPU #17498

Closed jossmt closed 4 years ago

jossmt commented 4 years ago

I upgraded node version and updated Developer Tools on my macbook and when trying to build my angular project it is getting stuck at 11% 13/13 modules and cpu usage is upwards of 150%...

Mac details: MacBook Pro (16-inch, 2019) Mac OS Catalina 10.15.3

Can anyone help? I have provided by package.json below:

{ "name": "collaborate-ui", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "~9.1.2", "@angular/cdk": "^9.2.0", "@angular/common": "~9.1.2", "@angular/compiler": "~9.1.2", "@angular/core": "~9.1.2", "@angular/forms": "~9.1.2", "@angular/localize": "^9.0.7", "@angular/material": "^9.2.0", "@angular/platform-browser": "~9.1.2", "@angular/platform-browser-dynamic": "~9.1.2", "@angular/router": "~9.1.2", "@ng-bootstrap/ng-bootstrap": "^6.0.1", "bootstrap": "^4.4.1", "jquery": "^3.4.1", "popper": "^1.0.1", "popper.js": "^1.16.1", "rxjs": "~6.5.4", "tslib": "^1.10.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-devkit/build-angular": "^0.900.7", "@angular/cli": "~9.1.1", "@angular/compiler-cli": "~9.1.2", "@angular/language-service": "~9.1.2", "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^5.1.2", "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.3.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~2.1.0", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.2", "node-gyp": "^6.1.0", "protractor": "~5.4.3", "ts-node": "~8.3.0", "tslint": "~5.18.0", "typescript": "~3.7.5" } }

Things I have tried: Reinstalling node/npm Reinstalling angular/cli angular/core etc. Removing all node modules and reinstalling Updating fsevents Updating node-gyp Restarting altogether

I have heard mention of fsevents needing to be a certain version. When running npm ls fsevents i get:

├─┬ @angular-devkit/build-angular@0.900.7 │ ├─┬ webpack@4.41.2 │ │ └─┬ watchpack@1.6.1 │ │ └─┬ chokidar@2.1.8 │ │ └── fsevents@1.2.12 │ └─┬ webpack-dev-server@3.9.0 │ └─┬ chokidar@2.1.8 │ └── fsevents@1.2.12 ├─┬ @angular/compiler-cli@9.1.2 │ └─┬ chokidar@3.3.1 │ └── fsevents@2.1.2 └─┬ popper@1.0.1 ├─┬ mocha@7.1.1 │ └─┬ chokidar@3.3.0 │ └── fsevents@2.1.2 deduped └─┬ rijs.resdir@1.4.4 └─┬ chokidar@1.7.0 └── fsevents@1.2.12

Evidently I cannot update fsevents version for chokidar - what is the workaround here? Any help much appreciated!

alan-agius4 commented 4 years ago

Can you please share the output of ng version?

jossmt commented 4 years ago

After running ng version:

@angular-devkit/architect 0.901.3 @angular-devkit/build-angular 0.901.3 @angular-devkit/build-optimizer 0.901.3 @angular-devkit/build-webpack 0.901.3 @angular-devkit/core 9.1.3 @angular-devkit/schematics 9.1.3 @angular/cdk 9.2.1 @angular/localize 9.1.2 @angular/material 9.2.1 @ngtools/webpack 9.1.3 @schematics/angular 9.1.3 @schematics/update 0.901.3 rxjs 6.5.5 typescript 3.8.3 webpack 4.42.0

julkue commented 4 years ago

I also have the problem of a stuck ng serve since today.

30% building 38/38 modules 0 active

julkue commented 4 years ago

Update: In my case it seems to be caused by node-sass. Unfortunately the log of ng serve will not output anything before it gets stuck with --verbose=true so I still don't know the reason. But I've found the reason in my app: It was caused by an import of mixins/variables but with no CSS class inside that file. So the only content was that import. When removing that, it's no longer stuck.

elucidsoft commented 4 years ago

I have also seen this behavior constantly with the latest versions of everything installed. I NEVER saw this behavior before I updated everything to the latest versions. This is 100% a bug of some sort, it happens ALL the time to me for no apparent reason. It happens in different locations, just now it got stuck hashing 88% and just sat there...

I also want to add my update was from compiler-cli 9.1.0 -> 9.1.9

alan-agius4 commented 4 years ago

Hi, is it possible to share a reproduction of some sort even privately?

Unfortunately, without a reproduction there is not much that we can do.

Thanks.

elucidsoft commented 4 years ago

This is an odd one, I deleted my node_modules and ran npm i to get a fresh update and it hasn't happened in several days. Very odd.

elucidsoft commented 4 years ago

I still haven't seen this recur after performing my steps.

Maksiemens commented 4 years ago

same problem when I updated project from angular 9.1.9 to 9.1.11. compiling freeze with file in cmd dist\cjs.js??ref--13-3 in style.scss. Than my pc out of memory. I had to downgrade project

windows 10

"dependencies": { "@angular/animations": "^9.1.11", "@angular/cdk": "^9.2.4", "@angular/common": "~9.1.11", "@angular/compiler": "~9.1.11", "@angular/core": "~9.1.11", "@angular/forms": "~9.1.11", "@angular/platform-browser": "~9.1.11", "@angular/platform-browser-dynamic": "~9.1.11", "@angular/router": "~9.1.11", "@auth0/angular-jwt": "^4.2.0", "@ng-select/ng-select": "^4.0.0", "@ngrx/effects": "^9.2.0", "@ngrx/entity": "^9.2.0", "@ngrx/router-store": "^9.2.0", "@ngrx/store": "^9.2.0", "@ngrx/store-devtools": "^9.2.0", "hammerjs": "^2.0.8", "ng-lazyload-image": "^8.0.1", "ng-svg-icon-sprite": "^1.8.0", "ng2-tooltip-directive": "^2.9.20", "ngx-drag-scroll": "^9.0.0-beta.2", "ngx-image-cropper": "^3.1.9", "ngx-infinite-scroll": "^9.0.0", "ngx-perfect-scrollbar": "^9.0.0", "ngx-scrollbar": "^7.2.3", "ngx-smart-modal": "^7.4.1", "ngx-swiper-wrapper": "^9.0.1", "ngx-toastr": "^12.1.0", "ngx-virtual-scroller": "^4.0.3", "overlayscrollbars": "^1.12.0", "overlayscrollbars-ngx": "^0.2.2", "rxjs": "~6.5.5", "simplebar-angular": "^2.2.0", "tslib": "^2.0.0", "zone.js": "~0.10.3" }, "devDependencies": { "@angular-devkit/build-angular": "~0.901.8", "@angular/cli": "^9.1.8", "@angular/compiler-cli": "~9.1.11", "@angular/language-service": "~9.1.11", "@ngrx/schematics": "^9.2.0", "@types/jasmine": "~3.5.10", "@types/jasminewd2": "~2.0.8", "@types/node": "^14.0.13", "codelyzer": "^5.2.2", "cross-env": "^7.0.2", "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~5.0.2", "karma": "~5.1.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "^3.0.3", "karma-jasmine": "~3.3.1", "karma-jasmine-html-reporter": "^1.5.4", "prettier": "^2.0.5", "pretty-quick": "^2.0.1", "protractor": "~7.0.0", "stylelint": "^13.6.0", "stylelint-order": "^4.1.0", "stylelint-selector-bem-pattern": "^2.1.0", "svg-sprite": "^1.5.0", "svg2sprite-cli": "^2.0.1", "ts-node": "~8.10.2", "tslint": "~6.1.2", "typescript": "~3.8.3", "webpack-bundle-analyzer": "^3.8.0" }

alan-agius4 commented 4 years ago

Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information.

If the problem persists, please file a new issue and ensure you provide all of the required information when filling out the issue template.

angular-automatic-lock-bot[bot] commented 4 years ago

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.