angular-extensions / pretty-html-log

A module that allows you to pretty print the inner HTML of ComponentFixtures, DebugElements, NativeElements or even plain HTML strings to the console. This is very useful for debugging Angular component tests in Jest
MIT License
37 stars 1 forks source link

Incompatible with npm 7 #28

Closed peterpeterparker closed 3 years ago

peterpeterparker commented 3 years ago

Actual Behavior

This package fails when installed with npm@7

npm -v 7.6.3 ng new my-app ... cd my-app npm i @angular-extensions/pretty-html-log npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: my-app@0.0.0 npm ERR! Found: @angular/common@11.0.9 npm ERR! node_modules/@angular/common npm ERR! @angular/common@"~11.0.6" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/common@"9 - 10" from @angular-extensions/pretty-html-log@3.1.3 npm ERR! node_modules/@angular-extensions/pretty-html-log npm ERR! @angular-extensions/pretty-html-log@"*" 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.

Expected Behavior

Being compatible with npm@7

Workaround

Downgrade to npm@6.14.11

Side Note

Angular has been upgraded to support npm@7 (see #19957)

kreuzerk commented 3 years ago

HI @peterpeterparker. I will try to upgrade it to the latest Angular version. Hope that this fixes the issue.

kreuzerk commented 3 years ago

@peterpeterparker I just published v4, can you try again?

peterpeterparker commented 3 years ago

Mmmmh still get the same error @kreuzerk but maybe I am missing something?

I created a blank new angular app to be sure but still get

npm ERR! Could not resolve dependency: npm ERR! peer @angular/common@"9 - 10" from @angular-extensions/pretty-html-log@4.0.0 npm ERR! node_modules/@angular-extensions/pretty-html-log npm ERR! dev @angular-extensions/pretty-html-log@"4.0.0" from the root project

I did

peterpeterparker commented 3 years ago

Is it because of this dependencies requirement?

https://github.com/angular-extensions/pretty-html-log/blob/70933ae3b77b26426d338b94de922d6230887ba8/projects/pretty-html-log/package.json#L11

kreuzerk commented 3 years ago

Yes forgot to update the dependency range. That's something that happens to me many times during ng updates. Will deliver a fix. Thx for letting me know