npm cannot resolve peer dependency @angular/common@">=14.0.0" from ngx-highlightjs@7.0.1
Konntroll opened this issue · comments
Reproduction
Run npm i ngx-highlightjs
.
Expected Behavior
Package installs.
Actual Behavior
The following error is reported:
While resolving: client-admin@0.0.0
Found: @angular/common@11.2.14
node_modules/@angular/common
@angular/common@"~11.2.9" from the root project
Could not resolve dependency:
peer @angular/common@">=14.0.0" from ngx-highlightjs@7.0.1
node_modules/ngx-highlightjs
ngx-highlightjs@"*" from the root project
Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
Additional info
Running npm i --legacy-peer-deps ngx-highlightjs
installs the package as expected, but attempts to use it as suggested in the read-me fail with a bunch of errors attributed to the package.
Environment
- Angular: 11.2.14
- ngx-highlightjs: 7.0.1
- Operating System: Windows 10
The actual behavior is correct! you need to upgrade to Angular 14 or try to force installing the package npm i ngx-highlightjs --force
if it didn't work and you don't want to upgrade your Angular version, then use a previous version like v4.1.3, read what have changed here https://github.com/MurhafSousli/ngx-highlightjs/blob/master/CHANGELOG.md#413