Squidex / squidex

Headless CMS and Content Managment Hub
https://squidex.io
MIT License
2.26k stars 453 forks source link

Frontend restore npm package was wrong #1111

Closed sgalcheung closed 2 months ago

sgalcheung commented 3 months ago

My env Mac OS 12.7.5 Node v18.20.3 Npm 10.7.0

npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @lithiumjs/angular@7.3.1
npm ERR! Found: @angular/core@18.0.1
npm ERR! node_modules/@angular/core
npm ERR!   @angular/core@"18.0.1" from the root project
npm ERR!   peer @angular/core@"18.0.1" from @angular/animations@18.0.1
npm ERR!   node_modules/@angular/animations
npm ERR!     @angular/animations@"18.0.1" from the root project
npm ERR!     peerOptional @angular/animations@"18.0.1" from @angular/platform-browser@18.0.1
npm ERR!     node_modules/@angular/platform-browser
npm ERR!       @angular/platform-browser@"18.0.1" from the root project
npm ERR!       7 more (@angular/forms, @angular/platform-browser-dynamic, ...)
npm ERR!     1 more (@angular/platform-server)
npm ERR!   16 more (@angular/cdk, @angular/cdk-experimental, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@">=11.0.0 <18.0.0" from @lithiumjs/angular@7.3.1
npm ERR! node_modules/@lithiumjs/angular
npm ERR!   @lithiumjs/angular@"^7.3.1" from the root project
npm ERR!   peer @lithiumjs/angular@">=7.0.0" from @lithiumjs/ngx-virtual-scroll@0.3.1
npm ERR!   node_modules/@lithiumjs/ngx-virtual-scroll
npm ERR!     @lithiumjs/ngx-virtual-scroll@"^0.3.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/core@16.2.12
npm ERR! node_modules/@angular/core
npm ERR!   peer @angular/core@">=11.0.0 <18.0.0" from @lithiumjs/angular@7.3.1
npm ERR!   node_modules/@lithiumjs/angular
npm ERR!     @lithiumjs/angular@"^7.3.1" from the root project
npm ERR!     peer @lithiumjs/angular@">=7.0.0" from @lithiumjs/ngx-virtual-scroll@0.3.1
npm ERR!     node_modules/@lithiumjs/ngx-virtual-scroll
npm ERR!       @lithiumjs/ngx-virtual-scroll@"^0.3.1" 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.
npm ERR! 
npm ERR! See /Users/sgalcheung/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can ......

The problem is caused by a version conflict with @angular/core. Specifically, @lithiumjs/angular requires a version of @angular/core between 11.0.0 and 17.0.0, but your project has version 18.0.1 installed.

sgalcheung commented 3 months ago

I changed this npm package version

    "@lithiumjs/angular": "^7.3.1",
    "@lithiumjs/ngx-virtual-scroll": "^0.3.1",
    "ngx-ui-tour-core": "^12.0.2",

upgrade version

    "@lithiumjs/angular": "^8.0.0",
    "@lithiumjs/ngx-virtual-scroll": "^0.3.2",
    "ngx-ui-tour-core": "13.0.0",

and it works well.

SebastianStehle commented 3 months ago

Thank you very much. The last time I checked this packages were not available. Would you create a PR for your change?

sgalcheung commented 3 months ago

No, I don’t think this can resolve the problem, it is a temp method, the original problem maybe the GitHub bot only check single npm package, but not recognizes all of the npm packages, and they dependence in the project.

SebastianStehle commented 3 months ago

I don't use the github bot. What I meant is that I have checked the dependencies locally when I migrated to angular 18.

sgalcheung commented 3 months ago

Ok, I'll create the PR.

获取 Outlookhttps://aka.ms/qtex0l for iOS 章思高


From: Sebastian Stehle @.> Sent: Wednesday, July 24, 2024 4:41:03 AM To: Squidex/squidex @.> Cc: Sgal Cheung @.>; Author @.> Subject: Re: [Squidex/squidex] Frontend restore npm package was wrong (Issue #1111)

I don't use the github bot. What I meant is that I have checked the dependencies locally when I migrated to angular 18.

― Reply to this email directly, view it on GitHubhttps://github.com/Squidex/squidex/issues/1111#issuecomment-2246271805, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKEYGHOCU4HGYZQVBC2LR4DZN25V7AVCNFSM6AAAAABLKCTCQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBWGI3TCOBQGU. You are receiving this because you authored the thread.Message ID: @.***>

sgalcheung commented 2 months ago

I forgot to commit the package-lock.json, but it does not cause an error, it will auto-update the package-lock.json file when running the npm install so that everyone can add it to the next commit.

SebastianStehle commented 2 months ago

Yes. I have realized it after I have merged your PR :D