geonetwork / geonetwork-ui

GeoNetwork UI is a suite of Applications made to provide a modern facade to your GeoNetwork 4 catalog. It also provides Web Components to embed various parts of your data catalog in third party websites.
https://geonetwork.github.io/geonetwork-ui/main/docs/
GNU General Public License v2.0
63 stars 32 forks source link

Install package from npm with Angular 17.2 #806

Open xwanner opened 6 months ago

xwanner commented 6 months ago

Starting from a fresh new project with node 20.9 and angular 17.2, I cannot install geonetwork-ui from npm.

The command : npm install --save geonetwork-ui

Returns :

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: theia-catalog@0.0.0
npm ERR! Found: @angular/common@17.2.2
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"^17.2.0" from the root project
npm ERR!   peer @angular/common@"16.x || 17.x" from geonetwork-ui@2.1.0
npm ERR!   node_modules/geonetwork-ui
npm ERR!     geonetwork-ui@"*" from the root project
npm ERR!   8 more (@angular/cdk, @angular/forms, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^16.0.0 || ^16.1.0-next.0" from @nguniversal/express-engine@16.2.0
npm ERR! node_modules/@nguniversal/express-engine
npm ERR!   peer @nguniversal/express-engine@"16.x || 17.x" from geonetwork-ui@2.1.0
npm ERR!   node_modules/geonetwork-ui
npm ERR!     geonetwork-ui@"*" 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! 
npm ERR! For a full report see:
npm ERR! /home/ubuntu/.npm/_logs/2024-02-26T10_47_45_778Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /home/ubuntu/.npm/_logs/2024-02-26T10_47_45_778Z-debug-0.log
jahow commented 6 months ago

Hi, thanks for your interest in the project!

It looks like not specifying an option when doing npm i geonetwork-ui will try to pull the version tagged latest (see https://www.npmjs.com/package/geonetwork-ui?activeTab=versions). This version hasn't been updated in a few months and to have anything working you would need to do npm i geonetwork-ui@dev.

Please keep in mind that the dev version is updated on every commit in the main branch of the project, so things might change quickly and without notice. Also, we would be very interested in hearing from your experience while using the NPM package, thanks!!

xwanner commented 6 months ago

Thank you for your help,

Indeed with the @dev flag it did the trick.

I will try to work with this npm version and I will keep you informed if anything go wrong.