Fix the Upstream Dependency Conflict Installing Npm Packages

Fix the upstream dependency conflict installing NPM packages

It looks like it's a problem with peer dependencies in the latest version of npm (v7) which is still a beta version.

Try with npm install --legacy-peer-deps. For detailed information check the blog post npm v7 Series - Beta Release! And: SemVer-Major Changes in npm v7.

Unable to resolve dependency tree error when installing npm packages

This is not related to an HTTP proxy.

You have dependency conflict (incorrect and potentially broken dependency) as it says, so try to run the command with --force, or --legacy-peer-deps. If it doesn't take effect, the temporary solution is using prior versions of the Node.js (downgrading the Node.js version) as it causes this kind of errors to happen sometimes.

Update based on the OP's update:

As you see, it fires the following error:

No matching version found for @angular/http@^9.1.4.

Take a look at angular/http page. Note that the latest version for that deprecated package is 7.2.16 while you request an upper version (e.g., ^9.1.4)! So, try to check the project dependencies and follow the raised errors in order to solve the problem.

How to solve dependency conflict with NPM

Above, you mentioned project repository consists yarn.lock file and doesn't consist package-lock.json. More than that inside the package.json there are many yarn commands defined. So the above project is initiated with yarn. So you need to use yarn commands instead of npm.

For that first check if you have yarn installed in your machine or not. using yarn check.
If not installed then install yarn using npm install --global yarn.
Then using yarn install --immutable --immutable-cache --check-cache do a clean install. It is a similar command to npm ci when you use npm.

To learn more about yarn check yarn doc



Related Topics



Leave a reply



Submit