carbon-icons-angular icon indicating copy to clipboard operation
carbon-icons-angular copied to clipboard

[Bug]Angular 13 +Node 16 :- npm i gives error due to @carbon/[email protected] version peer dependency issue

Open rachwani opened this issue 1 year ago • 0 comments

My environment is:

Angular: 13 Node:16.14.0

Package.json looks like "dependencies": { "@angular/animations": "13.4.0", "@angular/cdk": "^13.3.9", "@angular/common": "13.4.0", "@angular/compiler": "13.4.0", "@angular/core": "13.4.0", "@angular/forms": "13.4.0", "@angular/localize": "13.4.0", "@angular/platform-browser": "13.4.0", "@angular/platform-browser-dynamic": "13.4.0", "@angular/platform-server": "13.4.0", "@angular/router": "13.4.0", "@angularclass/hmr": "2.1.3", "@carbon/charts-angular": "^0.58.2", "@carbon/icons": "^10.48.1", "@carbon/icons-angular": "^11.2.2", "@carbon/themes": "^10.55.2", "@ngx-translate/core": "11.0.1", "@ngx-translate/http-loader": "4.0.0", "angular2-multiselect-dropdown": "4.6.0", "animate.css": "^3.7.2", "bootstrap": "4.3.1", "carbon-components": "^10.58.3", "carbon-components-angular": "^4.75.3 ", "chart.js": "^2.9.4", "chartist": "^0.11.0", "core-js": "^3.31.1", "d3": "^7.8.5", "file-saver": "^2.0.5", "follow-redirects": "1.14.8", "font-awesome": "4.7.0", "http-server": "^14.1.1", "ibm-design-icons": "^2.1.4", "ie-shim": "^0.1.0", "intl": "^1.2.5", "ionicons": "^2.0.1", "jquery": "^3.7.0", "jquery-slimscroll": "^1.3.8", "json2typescript": "1.4.1", "lodash-es": "^4.17.21", "moment": "2.29.4", "moment-timezone": "^0.5.43", "ng-inline-svg": "^11.0.2", "ng2-tree": "^2.0.0-rc.11", "ngx-bootstrap": "^5.6.2", "ngx-infinite-scroll": "8.0.2", "ngx-mask": "^10.0.4", "ngx-moment": "3.4.0", "ngx-pagination": "4.1.0", "ngx-select-dropdown": "^1.5.0", "ngx-uploader": "^11.0.0", "normalize.css": "^8.0.1", "popper.js": "1.15.0", "reflect-metadata": "0.1.13", "rxjs": "6.6.0", "svgxuse": "^1.2.6", "tether": "^1.4.7", "tslib": "^2.6.1", "zone.js": "~0.11.8" }

This works well when I do npm I with node 14.X.X (as npm is stricter in node 16 it gives an error)

When I do npm install in node 16 it gives the below error

Note: The requirement here is to be on node 16 and angular 13 (so downgrading is not an option )

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: @angular/[email protected] npm ERR! node_modules/@angular/compiler npm ERR! @angular/compiler@"13.4.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/compiler@"^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0" from @carbon/[email protected] npm ERR! node_modules/@carbon/icons-angular npm ERR! @carbon/icons-angular@"^11.2.2" 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!

So it looks like @carbon/[email protected] peer dependency @angular/compiler is supported till 11 version

So the only solution it shows is to use --force or --legacy-peer-deps

How can I do an npm install without using --force or --legacy-peer-deps?

is there any latest package coming which resolves this compatibility issue with angular 13 + node.js

rachwani avatar Aug 02 '23 07:08 rachwani