angular / angular-cli

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

Yarn install 3 slower after upgrade to 13.2.0 #22650

Closed elvirdolic closed 2 years ago

elvirdolic commented 2 years ago

🐞 Bug report

Yarn install takes 3x more time to finish installation and move on

Command (mark with an x)

yarn install

Is this a regression?

yes: works normal till version 13.2.0

Description

Upgrading from 13.1.4 to 13.2.0 yarn takes ~9-10 minutes On 13.1.4 it takes 2-3 minutes for our repo

🔬 Minimal Reproduction

Not sure if that can be reproduced but here is a list of packages used, same packages just upgrade of angular-cli makes yarn install slower.

 "dependencies": {
    "@almothafar/angular-signature-pad": "^4.0.1",
    "@angular-architects/module-federation": "14.0.2",
    "@angular-builders/dev-server": "^7.3.1",
    "@angular/animations": "13.2.1",
    "@angular/cdk": "13.2.1",
    "@angular/common": "13.2.1",
    "@angular/compiler": "13.2.1",
    "@angular/core": "13.2.1",
    "@angular/flex-layout": "13.0.0-beta.36",
    "@angular/forms": "13.2.1",
    "@angular/google-maps": "13.2.1",
    "@angular/material": "13.2.1",
    "@angular/platform-browser": "13.2.1",
    "@angular/platform-browser-dynamic": "13.2.1",
    "@angular/router": "13.2.1",
    "@angular/service-worker": "13.2.1",
    "@apollo/client": "3.3.20",
    "@capacitor/core": "^3.3.1",
    "@microsoft/applicationinsights-web": "2.6.1",
    "@ngrx/component-store": "13.0.1",
    "@ngrx/effects": "13.0.1",
    "@ngrx/entity": "13.0.1",
    "@ngrx/router-store": "13.0.1",
    "@ngrx/store": "13.0.1",
    "@ngrx/store-devtools": "13.0.1",
    "@ngx-pwa/local-storage": "13.0.2",
    "@ngx-translate/core": "14.0.0",
    "@ngx-translate/http-loader": "7.0.0",
    "@nrwl/angular": "13.7.2",
    "@nrwl/nx-cloud": "13.1.2",
    "@nrwl/web": "13.7.2",
    "@nxtend/capacitor": "11.1.1",
    "@swimlane/ngx-charts": "^20.0.1",
    "@types/chart.js": "^2.8.5",
    "@zxing/browser": "^0.0.7",
    "@zxing/library": "^0.18.3",
    "@zxing/ngx-scanner": "3.4.0",
    "angular-oauth2-oidc": "13.0.1",
    "angulartics2": "12.0.0",
    "apollo-angular": "^2.6.0",
    "apollo-server-express": "^2.19.0",
    "base64-js": "^1.3.0",
    "cache-manager": "^3.4.1",
    "chart.js": "2.8.0",
    "core-js": "3.19.2",
    "d3": "5.7.0",
    "dayjs": "^1.10.5",
    "deep-equal": "1.0.1",
    "file-saver": "1.3.8",
    "graphql": "^16.0.1",
    "graphql-tools": "^8.2.0",
    "hammerjs": "^2.0.8",
    "html2canvas": "^1.0.0-rc.7",
    "immer": "9.0.1",
    "jwt-decode": "^3.1.2",
    "lcov-result-merger": "^3.1.0",
    "lodash-es": "^4.17.21",
    "lunr": "^2.3.9",
    "marked": "^0.6.0",
    "ng-gallery": "^6.0.0",
    "ngx-highlightjs": "^5.0.0",
    "ngx-mat-select-search": "4.0.1",
    "ngx-tinymce": "13.0.0",
    "ngx-toastr": "14.2.1",
    "node-sass-json-importer": "^4.3.0",
    "panzoom": "^9.4.1",
    "paper": "^0.12.12",
    "reflect-metadata": "^0.1.13",
    "rxjs": "7.4.0",
    "sass": "^1.34.0",
    "save-svg-as-png": "^1.4.7",
    "svg.js": "^2.6.5",
    "tslib": "2.3.0",
    "xml-js": "^1.6.11",
    "xml2js": "^0.4.23",
    "xmlbuilder": "^15.1.1",
    "zone.js": "0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "13.1.4",
    "@angular-eslint/eslint-plugin": "13.0.1",
    "@angular-eslint/eslint-plugin-template": "13.0.1",
    "@angular-eslint/template-parser": "13.0.1",
    "@angular/cli": "13.1.4",
    "@angular/compiler-cli": "13.2.1",
    "@angular/language-service": "13.2.1",
    "@azure/storage-blob": "^12.0.0",
    "@capacitor/android": "^3.3.1",
    "@capacitor/ios": "^3.3.1",
    "@cypress/webpack-batteries-included-preprocessor": "^2.2.3",
    "@jscutlery/cypress-harness": "^0.3.9",
    "@nestjs/schematics": "^7.0.0",
    "@nestjs/testing": "^7.0.0",
    "@ngrx/schematics": "13.0.1",
    "@nrwl/cli": "13.7.2",
    "@nrwl/cypress": "13.7.2",
    "@nrwl/eslint-plugin-nx": "13.7.2",
    "@nrwl/jest": "13.7.2",
    "@nrwl/linter": "13.7.2",
    "@nrwl/nest": "13.7.2",
    "@nrwl/node": "13.7.2",
    "@nrwl/tao": "13.7.2",
    "@nrwl/workspace": "13.7.2",
    "@openapitools/openapi-generator-cli": "1.0.18-4.3.0",
    "@types/base64-js": "^1.2.5",
    "@types/cache-manager": "^3.4.0",
    "@types/clipboard": "2.0.1",
    "@types/deep-equal": "1.0.1",
    "@types/file-saver": "2.0.0",
    "@types/googlemaps": "3.43.3",
    "@types/hammerjs": "2.0.36",
    "@types/jasmine": "~3.3.0",
    "@types/jasminewd2": "2.0.6",
    "@types/jest": "27.0.2",
    "@types/jquery": "3.3.6",
    "@types/marked": "^0.6.0",
    "@types/node": "14.14.33",
    "@types/request": "^2.48.2",
    "@typescript-eslint/eslint-plugin": "5.10.1",
    "@typescript-eslint/parser": "5.10.1",
    "argparse": "^1.0.10",
    "axios": "^0.21.1",
    "azure-devops-node-api": "^10.1.1",
    "cypress": "9.3.1",
    "cypress-file-upload": "5.0.8",
    "dotenv": "10.0.0",
    "eslint": "8.7.0",
    "eslint-config-prettier": "8.1.0",
    "eslint-plugin-cypress": "2.12.1",
    "eslint-plugin-import": "latest",
    "eslint-plugin-react": "latest",
    "eslint-plugin-rxjs": "latest",
    "eslint-plugin-sonarjs": "^0.6.0",
    "eslint-plugin-you-dont-need-momentjs": "^1.6.0",
    "htmlhint": "^0.11.0",
    "husky": "2.2.0",
    "jasmine-core": "~3.10.1",
    "jasmine-marbles": "0.9.0",
    "jasmine-reporters": "^2.3.2",
    "jasmine-spec-reporter": "~5.0.0",
    "jest": "27.2.3",
    "jest-preset-angular": "11.0.0",
    "karma": "~6.3.4",
    "karma-chrome-launcher": "~3.1.0",
    "karma-cli": "2.0.0",
    "karma-coverage": "^2.0.3",
    "karma-jasmine": "~4.0.1",
    "karma-jasmine-html-reporter": "^1.5.0",
    "lighthouse": "^4.0.0",
    "lint-staged": "^10.1.6",
    "ng-packagr": "13.2.1",
    "node-xlsx": "^0.17.2",
    "postcss": "^8.3.9",
    "postcss-import": "^14.0.2",
    "postcss-preset-env": "^6.7.0",
    "postcss-url": "^10.1.1",
    "prettier": "2.5.1",
    "prettier-stylelint": "0.4.2",
    "pretty-quick": "2.0.1",
    "sass-loader": "^12.1.0",
    "simple-git": "^2.4.0",
    "stylelint": "^13.3.2",
    "stylelint-declaration-use-variable": "^1.7.2",
    "stylelint-regex": "^1.2.0",
    "stylelint-restrict": "^1.0.0",
    "stylelint-scss": "^3.17.1",
    "to-string-loader": "1.1.5",
    "ts-jest": "27.0.5",
    "ts-mocks": "^2.5.0",
    "ts-node": "9.1.1",
    "typescript": "4.5.5",
    "webfont": "^8.2.0",
    "webpack-bundle-analyzer": "^3.3.2",
    "yauzl": "^2.10.0"
  }

🔥 Exception or Error





🌍 Your Environment

Azure Devops Hosted Build Agent.

2022-02-04T11:42:18.4309573Z ##[section]Starting: CmdLine
2022-02-04T11:42:18.4318962Z ==============================================================================
2022-02-04T11:42:18.4319293Z Task         : Command line
2022-02-04T11:42:18.4319645Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2022-02-04T11:42:18.4319967Z Version      : 2.198.0
2022-02-04T11:42:18.4320192Z Author       : Microsoft Corporation
2022-02-04T11:42:18.4320561Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2022-02-04T11:42:18.4320980Z ==============================================================================
2022-02-04T11:42:18.7491794Z Generating script.
2022-02-04T11:42:18.7504969Z Script contents:
2022-02-04T11:42:18.7505242Z yarn
2022-02-04T11:42:18.7506875Z ========================== Starting Command Output ===========================
2022-02-04T11:42:18.7542462Z [command]/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/86b8856c-7805-4a39-a6db-61f8efe8b318.sh
2022-02-04T11:42:19.1999685Z yarn install v1.22.17
2022-02-04T11:42:19.3528716Z [1/5] Validating package.json...
2022-02-04T11:42:19.3595005Z [2/5] Resolving packages...
2022-02-04T11:42:21.5288741Z [3/5] Fetching packages...
2022-02-04T11:43:18.4821719Z [4/5] Linking dependencies...
2022-02-04T11:43:18.4888540Z warning " > sass-loader@12.4.0" has unmet peer dependency "webpack@^5.0.0".
2022-02-04T11:43:18.4994080Z warning " > @apollo/client@3.3.20" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.4995902Z warning "@nrwl/angular > jasmine-marbles@0.8.4" has incorrect peer dependency "rxjs@^6.5.3".
2022-02-04T11:43:18.4997091Z warning "@nrwl/angular > rxjs-for-await@0.0.2" has incorrect peer dependency "rxjs@^6.0.0".
2022-02-04T11:43:18.4998278Z warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.0" has unmet peer dependency "@babel/core@^7.0.1".
2022-02-04T11:43:18.4999553Z warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.0" has unmet peer dependency "@babel/preset-env@^7.0.0".
2022-02-04T11:43:18.5000824Z warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.0" has unmet peer dependency "babel-loader@^8.0.2".
2022-02-04T11:43:18.5002028Z warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.0" has unmet peer dependency "webpack@^4 || ^5".
2022-02-04T11:43:18.5026061Z warning "@nrwl/web > rollup-plugin-typescript2 > @yarn-tool/resolve-package > @ts-type/package-dts > ts-type@2.1.2" has unmet peer dependency "@types/bluebird@*".
2022-02-04T11:43:18.5028565Z warning "@nrwl/web > rollup-plugin-typescript2 > @yarn-tool/resolve-package > @ts-type/package-dts > ts-type@2.1.2" has unmet peer dependency "ts-toolbelt@^9.6.0".
2022-02-04T11:43:18.5029669Z warning " > @nxtend/capacitor@11.1.1" has incorrect peer dependency "@nrwl/workspace@^11.0.19".
2022-02-04T11:43:18.5033444Z warning " > @zxing/ngx-scanner@3.4.0" has incorrect peer dependency "@zxing/browser@^0.0.10".
2022-02-04T11:43:18.5096320Z warning " > @zxing/ngx-scanner@3.4.0" has incorrect peer dependency "rxjs@^6.6.3".
2022-02-04T11:43:18.5097771Z warning " > apollo-angular@2.6.0" has incorrect peer dependency "@angular/core@^6.1.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0".
2022-02-04T11:43:18.5099020Z warning " > apollo-angular@2.6.0" has incorrect peer dependency "graphql@>=0.11.0 <0.14.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5100162Z warning " > apollo-angular@2.6.0" has incorrect peer dependency "rxjs@^6.0.0".
2022-02-04T11:43:18.5102529Z warning " > apollo-server-express@2.25.3" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5106003Z warning "apollo-server-express > apollo-server-core@2.25.3" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5107048Z warning "apollo-server-express > apollo-server-types@0.9.0" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5108630Z warning "apollo-server-express > graphql-subscriptions@1.2.1" has incorrect peer dependency "graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5109651Z warning "apollo-server-express > graphql-tools@4.0.8" has incorrect peer dependency "graphql@^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5110712Z warning "apollo-server-express > apollo-server-core > @apollographql/graphql-upload-8-fork@8.1.3" has incorrect peer dependency "graphql@0.13.1 - 15".
2022-02-04T11:43:18.5111954Z warning "apollo-server-express > apollo-server-core > apollo-cache-control@0.14.0" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5113057Z warning "apollo-server-express > apollo-server-core > apollo-graphql@0.9.5" has incorrect peer dependency "graphql@^14.2.1 || ^15.0.0".
2022-02-04T11:43:18.5114142Z warning "apollo-server-express > apollo-server-core > apollo-server-errors@2.5.0" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5115281Z warning "apollo-server-express > apollo-server-core > apollo-server-plugin-base@0.13.0" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5116402Z warning "apollo-server-express > apollo-server-core > apollo-tracing@0.15.0" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5117489Z warning "apollo-server-express > apollo-server-core > graphql-extensions@0.15.0" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5118607Z warning "apollo-server-express > graphql-tools > apollo-link@1.2.14" has incorrect peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5119716Z warning "apollo-server-express > graphql-tools > apollo-utilities@1.3.4" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5120670Z warning "graphql-tools > @apollo/client@3.4.17" has incorrect peer dependency "graphql@^14.0.0 || ^15.0.0".
2022-02-04T11:43:18.5121476Z warning " > node-sass-json-importer@4.3.0" has unmet peer dependency "node-sass@>=3.5.3".
2022-02-04T11:43:18.5139284Z warning " > @cypress/webpack-batteries-included-preprocessor@2.2.3" has unmet peer dependency "@cypress/webpack-preprocessor@^5.4.4".
2022-02-04T11:43:18.5147232Z warning " > @jscutlery/cypress-harness@0.3.9" has unmet peer dependency "cypress-pipe@*".
2022-02-04T11:43:18.5147818Z warning " > @nestjs/testing@7.6.18" has unmet peer dependency "@nestjs/common@^7.0.0".
2022-02-04T11:43:18.5148374Z warning " > @nestjs/testing@7.6.18" has unmet peer dependency "@nestjs/core@^7.0.0".
2022-02-04T11:43:18.5168126Z warning " > eslint-plugin-sonarjs@0.6.0" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0 || ^7.0.0".
2022-02-04T11:43:18.5169014Z warning " > eslint-plugin-you-dont-need-momentjs@1.6.0" has incorrect peer dependency "eslint@^5.5.0".
2022-02-04T11:43:18.5775833Z warning Workspaces can only be enabled in private projects.
2022-02-04T11:52:28.7116051Z [5/5] Building fresh packages...
2022-02-04T11:52:46.9385487Z success Saved lockfile.
2022-02-04T11:52:46.9456516Z $ node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main
2022-02-04T11:52:48.7264886Z 
2022-02-04T11:52:48.7267856Z  >  NX   Angular CLI has been decorated to enable computation caching.
2022-02-04T11:52:48.7268394Z 
2022-02-04T11:52:51.0555003Z - apollo-angular/headers [es2015/esm2015] (https://github.com/kamilkisiela/apollo-angular)
2022-02-04T11:52:53.0090525Z - apollo-angular/headers [main/umd] (https://github.com/kamilkisiela/apollo-angular)
2022-02-04T11:52:53.4211611Z - apollo-angular/http [es2015/esm2015] (https://github.com/kamilkisiela/apollo-angular)
2022-02-04T11:52:54.0043524Z - apollo-angular/http [main/umd] (https://github.com/kamilkisiela/apollo-angular)
2022-02-04T11:52:54.5371846Z - apollo-angular/persisted-queries [es2015/esm2015] (https://github.com/kamilkisiela/apollo-angular)
2022-02-04T11:52:54.7122342Z - apollo-angular/persisted-queries [main/umd] (https://github.com/kamilkisiela/apollo-angular)
2022-02-04T11:52:54.8367919Z - apollo-angular [es2015/esm2015] (https://github.com/kamilkisiela/apollo-angular)
2022-02-04T11:52:55.1877858Z - apollo-angular [main/umd] (https://github.com/kamilkisiela/apollo-angular)
2022-02-04T11:52:55.5663976Z - apollo-angular/testing [es2015/esm2015] (https://github.com/kamilkisiela/apollo-angular)
2022-02-04T11:52:55.9184314Z - apollo-angular/testing [main/umd] (https://github.com/kamilkisiela/apollo-angular)
2022-02-04T11:52:56.4024574Z Done in 637.21s.
2022-02-04T11:52:56.5251566Z ##[section]Finishing: CmdLine
alan-agius4 commented 2 years ago

The issue appears to be that due to set of dependencies the node_modules directory is about 2Gb in size which of course takes time to download, install and link.

Installing all the @angular/, @angular-devkit/ packages only takes about 50s with the size of directory node_modules of around 380Mb.

Therefore this doesn't appear to be any issue with Angular packages.

elvirdolic commented 2 years ago

Yeah as I wrote it takes 2-3 minutes with @angular/cli: 13.1.4

just updating the version to 13.2.0, without any other changes it takes 9-10 minutes. That’s fully reproduce able on our CI build.

alan-agius4 commented 2 years ago

Using only official Angular packages version 3.2 the installation time is below a minute. This can also be observed when using ng new.

I suggest using yarns —verbose to analyse what is actually causing the problem.

angular-automatic-lock-bot[bot] commented 2 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.