[Solved] Npm install Error: verbose stack Error: unable to resolve dependency tree

[environment]

[email protected]

[email protected]

1. Analysis reason:

After investigation, 1. It is found that there is peer dependency in package.json, indicating the version of angular 7. X, which is incompatible with the version of angular 8. X that the current project depends on, resulting in compilation errors.

2, in addition, the original use of npm 6.x install is no problem, because npm 7.x on peer dependency compatibility requirements are higher, so the error is reported.

2. Solution:

Method 1: — force or — legacy peer DEPs

npm install –force

npm   install –legacy-peer-deps

Method 2:

Modify the dependency definition package.json of the problem component and the component version that peer dependency depends on.

Read More: