Open Closed

Angular app template broken #2130


User avatar
1
hillin created
  • ABP Framework version: v4.4.4
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Steps to reproduce the issue:"
  • Create an Angular app project from abp suite
  • Run npm i in the angular. Fails with errors. Here's the output:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: MyProject@0.0.0
npm ERR! Found: @angular/compiler@12.0.5
npm ERR! node_modules/@angular/compiler
npm ERR!   @angular/compiler@"~12.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"12.2.13" from @angular/localize@12.2.13
npm ERR! node_modules/@angular/localize
npm ERR!   peer @angular/localize@"^12.0.0" from @ng-bootstrap/ng-bootstrap@10.0.0
npm ERR!   node_modules/@ng-bootstrap/ng-bootstrap
npm ERR!     peer @ng-bootstrap/ng-bootstrap@">=6.0.0" from @abp/ng.components@4.4.4
npm ERR!     node_modules/@abp/ng.components
npm ERR!       @abp/ng.components@"~4.4.4" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
  • Try to run npm i --force, passes with many warnings
  • Run npm start. Fails with errors. Here's the output:
> MyProject@0.0.0 start
> ng serve --open

⠋ Generating browser application bundles (phase: setup)...An unhandled exception occurred: ENOENT: no such file or directory, lstat 'MyProject\angular\node_modules\@swimlane'

Here's what angular-errors.log says:

[error] Error: ENOENT: no such file or directory, lstat 'MyProject\angular\node_modules\@swimlane'
    at Object.realpathSync (node:fs:2486:7)
    at resolveGlobalStyles (MyProject\angular\node_modules\@angular-devkit\build-angular\src\webpack\configs\styles.js:34:31)
    at Object.getStylesConfig (MyProject\angular\node_modules\@angular-devkit\build-angular\src\webpack\configs\styles.js:67:70)
    at MyProject\angular\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:132:23
    at generateWebpackConfig (MyProject\angular\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:40:49)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async generateBrowserWebpackConfigFromContext (MyProject\angular\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:97:20)
    at async Object.generateI18nBrowserWebpackConfigFromContext (MyProject\angular\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:47:20)
    at async setup (MyProject\angular\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:128:47)

2 Answer(s)
  • User Avatar
    1
    muhammedaltug created

    Hello hillin,

    This error probably related with your node version. Angular version 12 in abp packages which in 4.4.4 version. By the angular document angular 12 needs node 14 or node 12(higher than 12.14.1). Please ensure your node version.

  • User Avatar
    0
    hillin created

    Thanks @muhammedaltug, uninstalling node 16 and replace it with node 14 instead did the trick.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11